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/


This post is tagged

Leave a Reply





Hi, I’m Mark.

I live in Shibuya, Tokyo. I make things that are fun to touch. Mostly for the iPhone and iPad.

 

I'm also CTO of Vinetrade, an exciting new venture. It's a fine wine trading platform (think stock exchange for investing in expensive wines).

 

Feel free to take a look around my app and freelance portfolio. If you like what you see and you're looking for a developer, give me a shout!

 

Email: markymcf@gmail.com

Twitter: @marky_mc

Comments on my work


"When I am not home it is a great app for checking up on Kanji I am not to familiar with. I recommend this app." - **** - Quick Kanji Dictionary, UK App Store review

 

"Easy app to figure out and use ... for it's purpose, it's a very good app to have!" - ***** - Quick Kanji Dictionary, US App Store review

 

"Très bon dictionnaire de kanjis, simple d'utilisation (par les sous-kanjis) et très complet." - **** - Quick Kanji Dictionary, French App Store review

 


"Very useful" - ***** - Quick Kanji Dictionary HD, US App Store review

 


"Very fun to play with friends, the graphics are stunning and colors are great." - ***** - Facemakr, US App Store Review

 


"It is like having a little "Purikura" machine (Japanese sticker photo booth) in your pocket!
All of the illustrations are awesome too!" - ***** - Monstermakr, US App Store Review

Categories