Hello stackoverflow’s guys !
I got a issue and i don’t know how to fix it…
I’ve got a StoryBoard with a UINavigationController which has a UIViewController as RootViewController. In this RootViewController i have 2 UIButton.
The first UIButton instantiateViewControllerWithIdentifier a UICollectionViewController it works great.
The seconde UIButton instantiateViewControllerWithIdentifier a UIViewController which has 2 UITableView. Here is my issue when i instantiate my UIViewController my 2 UITableView are well loaded BUT when i touch it ( scroll ) i got this error :
-[__NSCFType scrollViewDidScroll:]: unrecognized selector sent to instance 0x752ff90
2012-11-21 10:22:49.300 Month[19992:11303] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType scrollViewDidScroll:]: unrecognized selector sent to instance 0x752ff90'
But when i made it RootViewController everyworks as i want… so i got a crash only when the RootViewController instantiate my UIViewController.
this is how i instantiate my UIViewController when i press the UIButton :
DayViewController *viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"calendarDay"];
Hope you can help me with those informations.
Regards,
It looks as though you have an object that you’re using as a
UIScrollViewDelegateand that object is being released too early. ([__NSCFType scrollViewDidScroll:]indicates that the message is being sent to a Core Foundation item, which probably means an object address is being reused for something else.)The code you show for creating a
DayViewControllerwill assign the object to a local variable. Assuming you’re using ARC, if that’s the object being used as the delegate, try assigning it to a strong property instead. Such as: