sigh WWDC 之前的星期五不是问这个问题的好时机,但值得一试。
我创建了一个基于 UIViewController 的项目,并从第一个 VC 中尝试通过按钮操作方法加载第二个。我执行以下代码:
SaveLocationViewController *saveLocationViewController = [[SaveLocationViewController alloc]
initWithNibName:@"SaveLocationViewController" bundle:nil];
[self presentModalViewController:saveLocationViewController animated:YES];
而且......没有任何可见的事情发生。通过断点,我可以看到 viewDidLoad 和 viewWillAppear 都在 saveLocationViewController 中被调用,所以它正在加载,但视图没有显示。
saveLocationViewController 包含对 initWithNibName 的调用,这是 Apple 样板代码的一部分,但将其取出并没有任何区别。NIB 似乎是正确的,视图已连接,我没有收到任何错误,视图只是不显示。我仍然看到原始视图。
任何提示/建议?