首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >iOS 7.1崩溃:-[UINavigationBar setItems:UINavigationBar:]

iOS 7.1崩溃:-[UINavigationBar setItems:UINavigationBar:]
EN

Stack Overflow用户
提问于 2014-03-11 21:36:52
回答 1查看 409关注 0票数 0

我正在经历一个全新的崩溃,在所有iPhone设备上使用iOS 7.1,我想知道其他人是否也看到了同样的情况。

代码语言:javascript
复制
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)是安装在UINavigationController中的自定义UIViewController容器。其要点是将iPhone屏幕的上半部分和下半部分分割开来,并在上半部分中选择扩展或缩小下半部分。当子视图控制器被展开以填充屏幕时,容器向它请求它的UINavigationItem并设置导航栏项。

有趣的是,这种崩溃在iOS 7.1上是新的;它在6.x和7.0.x上运行得很好。

还有其他人在这个方法调用中看到了新的崩溃,这是以前没有发生过的?

崩溃的呼叫站点:

代码语言:javascript
复制
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];
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-03-22 14:26:16

-[UINavigationBar setItem:animated:] 7.1中不允许在由UINavigationController管理的导航栏上调用iOS

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22337195

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档