[英]pushViewController Not Working on iOS 5 (OK on iOS 6)
I have a UINavigationController that displays several buttons on screen. 我有一个UINavigationController,它在屏幕上显示几个按钮。 They all simply use the line:
他们都简单地使用以下行:
myViewController *newView = [[myViewController alloc] initWithNibName:@"myViewController"
bundle:nil];
[[self navigationController] pushViewController:newView animated:YES];
to transition to the next view. 过渡到下一个视图。 I have one such view controller however that results in a crash at this very line ONLY on iOS 5. It works perfectly fine on iOS 6. I am baffled.
我有一个这样的视图控制器,但是仅在iOS 5上导致此行崩溃。它在iOS 6上运行良好。我感到困惑。 There are no real details to the crash.
崩溃没有真正的细节。 It is a SIGABRT that highlights the main.m line:
这是SIGABRT,突出显示了main.m行:
exitStatus = UIApplicationMain( argc, argv, nil, NSStringFromClass([ApplicationDelegate class]));
I have no clue... 我没有任何线索...
Try this line: 试试这一行:
myViewController *newView = [[myViewController alloc] initWithNibName:@"myViewController"
bundle:[NSBundle mainBundle]];
in place of: 代替:
myViewController *newView = [[myViewController alloc] initWithNibName:@"myViewController"
bundle:nil];
I have experimented a similar issue an here are the steps that I feel need to be considered: 我已经尝试过类似的问题,以下是我认为需要考虑的步骤:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.