I have a page with a back button that takes me to an inbox. I do this in viewWillDisappear –
-(void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
[inboxToolbar removeFromSuperview ];
[inboxToolbar release];
}
If I do this a few times, the app crashes and the exception thrown is “unrecognized selector sent to instance”. This happens very intermittently. Any thoughts on how to go about fixing / debugging it?
Assuming the crash is accessing your
inboxToolbarivar, change your code to the following:This will ensure
inboxToolbardoes not keep a pointer to a deallocated object. You could also have other issues, would need to see the crash log and more of your code to be sure.