【发布时间】:2011-12-20 15:56:18
【问题描述】:
我正在使用以下代码来推送我的视图控制器,除非按下 UIButton - 除了 NSLog 语句之外什么都没有发生:
-(IBAction)doChangePasscode{
NSLog(@"Change Passcode Screen Loaded!");
ChangePasscode *cpscreen = [[ChangePasscode alloc] initWithNibName:@"ChangePasscode" bundle:[NSBundle mainBundle]];
[self.navigationController pushViewController:cpscreen animated:YES];
}
我已经导入了相关文件(使用#import)所以一切都应该没问题...
为什么会这样?
谢谢!
【问题讨论】:
-
再次检查 cpscreen 和 Self.navigationController 是否不是 Nil。
-
尝试
NSLogself.navigationController 并检查它是否为零..
标签: iphone objective-c ios xcode uiviewcontroller