我在使用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];
}
答案 0 :(得分:1)
在iOS 7.1中禁止(并且新强制执行)在-[UINavigationBar setItem:animated:]
管理的导航栏上调用UINavigationController