当我尝试将视图控制器推送到我的UINavigationController时,我得到一个NSInvalidArgumentException抛出错误消息“无法识别的选择器发送到实例”。但这只发生在我将UINavigationController命名为ivar而不是“navigationController”时。有这个原因吗?
答案 0 :(得分:0)
不确定代码的结构,但每个UIViewController
都有navigationController
属性。 (见http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html)
因此,[self navigationController]
从当前视图控制器返回属性(无论self
是什么),而不是您在AppDelegate中命名的内容。