我在所有装有 iOS 7.1 的 iPhone 设备上都遇到了全新的崩溃,我想知道其他人是否也看到了同样的情况。
Date/Time: 2014-03-11 11:46:00.795 -0700
OS Version: iOS 7.1 (11D167)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 6
Last Exception Backtrace:
0 CoreFoundation 0x2d4dbefe __exceptionPreprocess + 126
1 libobjc.A.dylib 0x37c70ce2 objc_exception_throw + 32
2 CoreFoundation 0x2d4dbe40 +[NSException raise:format:] + 106
3 UIKit 0x2fe319a0 -[UINavigationBar setItems:animated:] + 98
4 Document 0x97aa6 -[FHHorizontalSplitViewController setVisibility:animated:] (FHHorizontalSplitViewController.m:233)
5 Document 0x98882 __44-[FHHorizontalSplitViewReplaceSegue perform]_block_invoke (FHHorizontalSplitViewController.m:450)
6 Document 0x9814a __72-[FHHorizontalSplitViewController _changeViewFramesAnimated:completion:]_block_invoke (FHHorizontalSplitViewController.m:335)
7 UIKit 0x2fd43788 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 278
8 UIKit 0x2fd433d2 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 172
9 UIKit 0x2fd432ea -[UIViewAnimationState animationDidStop:finished:] + 60
10 QuartzCore 0x2f98de06 CA::Layer::run_animation_callbacks(void*) + 228
11 libdispatch.dylib 0x38159d3a _dispatch_client_callout + 16
12 libdispatch.dylib 0x3815c6be _dispatch_main_queue_callback_4CF + 272
13 CoreFoundation 0x2d4a6674 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 2
14 CoreFoundation 0x2d4a4f40 __CFRunLoopRun + 1302
15 CoreFoundation 0x2d40f7a4 CFRunLoopRunSpecific + 518
16 CoreFoundation 0x2d40f586 CFRunLoopRunInMode + 100
17 GraphicsServices 0x3237c6ce GSEventRunModal + 132
18 UIKit 0x2fd6e88c UIApplicationMain + 1130
19 Document 0x80dbe main (main.m:12)
有问题的代码 ( FHHorizontalSplitViewController
) 是一个UIViewController
安装在UINavigationController
. 要点是它分割了 iPhone 屏幕的上半部分和下半部分,上半部分的选择扩展或收缩下半部分。当子视图控制器已展开以填满屏幕时,容器会向它询问UINavigationItem
并设置导航栏项。
有趣的是,这次崩溃是 iOS 7.1 上的新内容;它在 6.x 和 7.0.x 上运行良好。
其他人是否在此方法调用中看到了以前没有发生的新崩溃?
崩溃的呼叫站点:
UINavigationController *navVC = self.navigationController;
if (navVC) {
NSMutableArray *navigationItems = [NSMutableArray arrayWithArray:navVC.navigationBar.items;
NSInteger lastItem = [navigationItems count] - 1;
navigationItems[lastItem] = [self navigationItem];
[navVC.navigationBar setItems:navigationItems animated:YES];
}