Question

I'm using Flurry to track stats of my iPhone app, and lately I've been seeing several REALLY weird errors. Seemingly random objects are receiving a "numberOfSectionsInTableView" message, and I have no idea how/why. The app was built using the 4.2.1 SDK and targeted for iOS 4.0 devices. Here is a snippet of some examples:


NSInvalidArgumentException: -[NSCFString numberOfSectionsInTableView:]: unrecognized selector sent to instance 0x4f3de10

NSInvalidArgumentException: -[__NSCFData numberOfSectionsInTableView:]: unrecognized selector sent to instance 0x4f55bc0

NSInvalidArgumentException: -[NSPathStore2 numberOfSectionsInTableView:]: unrecognized selector sent to instance 0x4f5ebc0

NSInvalidArgumentException: -[__NSCFType numberOfSectionsInTableView:]: unrecognized selector sent to instance 0x2ac5f0

NSInvalidArgumentException: -[PLPhoto numberOfSectionsInTableView:]: unrecognized selector sent to instance 0x2fbc30

NSInvalidArgumentException: -[PLPhotoLibrary numberOfSectionsInTableView:]: unrecognized selector sent to instance 0x725ea20

I'm only specifying numberOfSectionsInTableView in my usual UITableView delegate methods, not calling it directly. The only code I found that calls this method directly was in the ASIHTTPRequest library:


    if (section == [self numberOfSectionsInTableView:aTableView]-1) {
        return 30;
    }
    return 0;

But this was in "ASIAuthenticationDialog.m" and I'm not using auth with ASIHTTPRequest.

Has anyone seen anything like this before? I'm open to any and all suggestions, pretty stumped here, and unable to reproduce it so far.

Thanks.

Was it helpful?

Solution

Sounds like a classic over-release problem. You have over-released an object and some other random object is being messaged instead.

Turn on zombie detection and try your test case again.

OTHER TIPS

I had same issue and my problem was that I created data source locally in method and it runs to same memory issue

- (void)setupDataSource {
  /* some code to create sections */
  TransactionDetailDataSource *dataSource = [[TransactionDetailDataSource alloc] initWithSections:sections];

  self.tableView.dataSource = dataSource;
  self.tableView.delegate = dataSource;

  [self.tableView reloadData];
}

...So I had to create new property

@property (nonatomic, strong) TransactionDetailDataSource *dataSource;

and add this line

self.dataSource = dataSource;

at the end of method.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top