我使用下面的代碼來推我的視圖控制器,當按下的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不無。 – HeikoG
嘗試'NSLog' self.navigationController並檢查它是否爲零。 – Legolas