When I try to push a view controller to my UINavigationController I get a NSInvalidArgumentException thrown with the error message "unrecognized selector sent to instance". But this only happens when I name开发者_StackOverflow my UINavigationController ivar anything other than "navigationController". Is there a reason for this?
Not sure how your code is structured, but every UIViewController
has a navigationController
property. (See http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html)
So, [self navigationController]
is returning the property from the current view controller (whatever self
is), not what you've named in your AppDelegate.
精彩评论