What's the method when clicking the back button on the navigation bar?

I am using UINavigationController to push and pop a view.

I used [[self navigationController] pushViewController:myView animated:YES]

to enter a view. Then I left clicked up to go back, I get the error:

*** -[NSCFDictionary superview]: unrecognized selector sent to instance 0x1451a0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFDictionary superview]: unrecognized selector sent to instance 0x1451a0'

      

I am wondering what method -popViewController

is called when the back button is called. Whether this error occurred in the first view or the second view that was clicked.

Thank.

0


source to share


1 answer


The back button must be called -popViewControllerAnimated :. However, it looks like you have a class superclass error. Basically, you have a view that is assigned to someone. This view is just an address in memory. At some point, you deallocate this view all the way to the persistence state 0. When this happens, the view is dealloc'd. At some point after this, the NSDictionary is created with the same memory address as your previous, now freed view. Now something is trying to send your message but it is no longer there, instead there is an NSDictionary in there. It says something like: [view superiew], but the view is now pointing to a dictal that is not responding to the supervisor.



Bottom line: check your save / deallocate / autoresponder calls and make sure you don't re-release one of your views (or view controllers, although this is less likely).

+3


source







All Articles