在xcode 4中使用UIModalTransitionStylePartialCurl导航时,在ios设备上崩溃 [英] crashing on ios device while navigation using UIModalTransitionStylePartialCurl in xcode 4
问题描述
我在ios 4设备上使用UIModalTransitionStylePartialCurl,在我的测试应用程序中,我有2个类,每个类中的单个按钮,在第一页onclick的按钮,它无法导航到第2页(通过卷曲页面向上),但在第二页,当我点击backbutton其崩溃,但不导航回我的第一页
以下是我的代码用于导航
i am using UIModalTransitionStylePartialCurl on the ios 4 device,in my test app i have 2 classes where a single button in each class, in first page onclick of the button it ill navigate to 2nd page (by curling the page up) but in the 2nd page when i click backbutton its crashing but not navigating back to my first page following is my code used for navigation
ViewController *MainWin = [[QIAViewController alloc] initWithNibName:NULL bundle:NULL];
MainWin.modalTransitionStyle = UIModalTransitionStylePartialCurl;
[self presentModalViewController:MainWin animated:YES];
[MainWin release];
这是崩溃日志:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present a nested modal view controller while curled <QIAAdminPassCnf: 0x583e040>.'
*** Call stack at first throw:
推荐答案
文档 UIModalTransitionStylePartialCurl
,您将看到一旦使用它,您就无法再显示任何模式视图。
If you read the documentation for UIModalTransitionStylePartialCurl
, you will see that once you've used it you can't present any more modal views.
如果你想返回,我想你应该做,
If you want to navigate back, I think you should do,
[self dismissModalViewControllerAnimated:YES];
而不是创建新的视图控制器实例。
rather than creating a new view controller instance.
这篇关于在xcode 4中使用UIModalTransitionStylePartialCurl导航时,在ios设备上崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!