iOS7崩溃 - 在View ViewController上调用PopViewController

时间:2013-09-23 09:16:04

标签: ios objective-c uiviewcontroller crash popviewcontroller

当我在景观ViewController上调用PopViewController时会发生崩溃。但是,当我在Portrait ViewController上调用PopViewController时,不会发生崩溃。

这只发生在iOS7上 - 以前工作正常......

  

[self.navigationController popViewControllerAnimated:TRUE];

我非常坚持这一点,所以任何帮助都会受到赞赏:)

这是我的Symbolocated崩溃日志:

  

异常类型:EXC_CRASH(SIGABRT)异常代码:   0x0000000000000000,0x0000000000000000由线程触发:0

     

Last Exception Backtrace:0 CoreFoundation
    0x2d9b2f4e __exceptionPreprocess + 126

     

1 libobjc.A.dylib 0x3801b6aa objc_exception_throw + 34

     

2 CoreFoundation 0x2d9b2e90 + [NSException   提升:格式:] + 100

     

3 UIKit 0x3020ee70 - [UIViewController   _preferredInterfaceOrientationForPresentationInWindow:fromInterfaceOrientation:]   + 496

     

4 UIKit 0x3020d6ae - [UIWindowController   过渡:fromViewController:toViewController:目标:didEndSelector:动画:]   + 2054

     

5 UIKit 0x3023ff86 - [UIViewController   _dismissViewControllerWithTransition:from:completion:] + 1390

     

6 UIKit 0x301ef1e0 - [UIViewController   dismissViewControllerWithTransition:completion:] + 1024

     

7 UIKit 0x303ecae2 - [UINavigationController   _popViewControllerAndUpdateInterfaceOrientationAnimated:] + 814 8 UIKit 0x301ef6de - [UINavigationController   _popViewControllerWithTransition:allowPoppingLast:] + 290

     

9 MyApp 0x00087e5a 0x55000 + 208474

     

10 MyApp 0x00088c56 0x55000 + 212054

     

11 MyApp 0x000889aa 0x55000 + 211370

     

12 MyApp 0x000a13f6 0x55000 + 312310

     

13 UIKit 0x3023b540 - [UIWindowController   transitionViewDidComplete:fromView:toView:removeFromView:] + 1908

     

14 UIKit 0x3023acf6 __101- [UIWindowController   过渡:fromViewController:toViewController:目标:didEndSelector:动画:] _ block_invoke293   + 166

     

15 UIKit 0x3023ac1e    - [_ UIViewControllerTransitionContext completeTransition:] + 70

     

16 UIKit 0x3023ab08 - [UITransitionView   notifyDidCompleteTransition:] + 284 17 UIKit
  0x3023a610 - [UITransitionView _didCompleteTransition:] + 940

     

18 UIKit 0x3015bc32 - [UIViewAnimationState   sendDelegateAnimationDidStop:finished:] + 174

     

19 UIKit 0x3015bb4a - [UIViewAnimationState   animationDidStop:已完成:] + 66

     

20 QuartzCore 0x2fdb3d04   CA :: Layer :: run_animation_callbacks(void *)+ 228

     

21 libdispatch.dylib 0x384fed62 _dispatch_client_callout   + 18

     

22 libdispatch.dylib 0x385057bc   _dispatch_main_queue_callback_4CF $ VARIANT $ mp + 264

     

23 CoreFoundation 0x2d97d81c    CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 4

     

24 CoreFoundation 0x2d97c0f0 __CFRunLoopRun + 1296

     

25 CoreFoundation 0x2d8e6ce2 CFRunLoopRunSpecific +   518

     

26 CoreFoundation 0x2d8e6ac6 CFRunLoopRunInMode + 102

     

27 GraphicsServices 0x325b427e GSEventRunModal + 134

     

28 UIKit 0x30188a3c UIApplicationMain + 1132

     

29 MyApp 0x0005ca84 0x55000 + 31364

     

30 MyApp 0x0005ca0c 0x55000 + 31244

2 个答案:

答案 0 :(得分:2)

原来,它在iOS7上崩溃的原因是由于前一个视图控制器上缺少一段代码告诉它将下一个上一页显示为肖像!

  

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {

return UIInterfaceOrientationPortrait; 
     

}

答案 1 :(得分:0)

也许你的视图控制器在旋转时已经被杀死,所以当你调用popViewControllerAnimated时它会崩溃。