在 Xcode 4 中编译时模态视图不起作用
我刚刚更新到 Xcode 4,在编译应用程序时遇到了一些问题,但现在已经解决了。然而,我的应用程序的导航存在一个主要问题。我有各种按钮,所有触发操作都应使用类似于以下的代码显示不同的模式窗口
- (IBAction)showMyJobs:(id)sender {
UIViewController *myJobsView = [[MyJobsView alloc] initWithNibName:@"MyJobsView" bundle:nil];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:myJobsView];
[self presentModalViewController:navigationController animated:YES];
[myJobsView release];
}
现在,在我在 xcode 4 中编译应用程序之前,所有这些代码都运行良好。现在发生的情况是代码似乎正在运行(看到它正在运行)在调试器中)但没有显示任何内容。谁能指出我正在发生的事情的正确方向。
编译时我没有收到任何错误/警告,什么也没有。这让我抓狂!
任何帮助将不胜感激。
I've just updated to Xcode 4 had a few problems getting the app to compile but they are sorted now. However I have a major problem with the navigation of my app. I have various buttons that all fire actions that should display different modal windows using code similar to the following
- (IBAction)showMyJobs:(id)sender {
UIViewController *myJobsView = [[MyJobsView alloc] initWithNibName:@"MyJobsView" bundle:nil];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:myJobsView];
[self presentModalViewController:navigationController animated:YES];
[myJobsView release];
}
Now all this code was working perfectly before I compiled the app in xcode 4. What happens now is that the code seems to run (see it running in the debugger) but nothing gets displayed. Can anyone point me in the right direction as to whats going on.
I don't get any errors/warnings while compiling, nothing. It's driving me mad!
Any help would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只是在黑暗中刺一下,但请尝试:
Just a stab in the dark, but try:
这确实很晚了,但无论它的价值如何 - 您需要先释放导航控制器,然后释放视图控制器。
This is really late, but for what its worth - you need to release the navigation controller first and then the view controller.