开发者

Is there a naming convention for a navigation controller?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜