Just a quickie in case someone out there is looking for a solution to the same problem.
I had a kind of custom tab bar controller setup running using a paged scrollview that held the views of a number of other view controllers , but when running I started getting the following error:
[__NSCFData numberOfSectionsInTableView:]: unrecognized selector sent to instance
After a quick bit of fiddling I found out that releasing the view controller in the following block of code meant that while the controller’s view was retained by being added as a subview, the actual controller was being released with a retain count of 0, throwing the above error.
AnalyticsViewController *analytics = [[AnalyticsViewController alloc] init];
[analytics.view setFrame:CGRectMake(scrollView.frame.size.width *4, 0, scrollView.frame.size.width, scrollView.frame.size.height)];
[scrollView addSubview:analytics.view];
[analytics release];
By commenting out the [analytics release]; line and adding it to the controller’s dealloc method, the crash went away. Some more info about this problem can be found here: http://imlocation.wordpress.com/2007/09/13/strange-objects-nscftype-indicate-memory-management-bugs/




Recent Comments