加载 NIB 时应用程序崩溃 - 但仅在固件升级到 iOS 5 后发生
我的应用程序的一些用户报告仅在固件升级到 iOS 5 后打开应用程序时才会发生崩溃。在固件升级之前一切都很好 - 包括运行应用程序并升级到应用程序的较新版本,然后运行它。
崩溃日志表明加载 NIB 时发生崩溃:
0 CoreFoundation 0x32bb38bf __exceptionPreprocess + 163
1 libobjc.A.dylib 0x36a1d1e5 objc_exception_throw + 33
2 CoreFoundation 0x32bb37b9 +[NSException raise:format:] + 1
3 CoreFoundation 0x32bb37db +[NSException raise:format:] + 35
4 UIKit 0x3169a747 -[UINib instantiateWithOwner:options:] + 1567
5 UIKit 0x3160a9cb -[UIViewController _loadViewFromNibNamed:bundle:] + 247
6 UIKit 0x314e9ea1 -[UIViewController loadView] + 89
7 UIKit 0x3145f78b -[UIViewController view] + 51
8 UIKit 0x3146bc39 -[UIViewController contentScrollView] + 25
9 UIKit 0x3146baa9 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 37
10 UIKit 0x3146b98f -[UINavigationController _layoutViewController:] + 35
11 UIKit 0x3146b211 -[UINavigationController _startTransition:fromViewController:toViewController:] + 501
12 UIKit 0x3146af53 -[UINavigationController _startDeferredTransitionIfNeeded] + 251
13 UIKit 0x3145f673 -[UINavigationController pushViewController:transition:forceImmediate:] + 807
14 UIKit 0x3145f349 -[UINavigationController pushViewController:animated:] + 37
出于某种原因,在 iOS 5 固件升级后删除并重新安装应用程序似乎可以解决该问题。
我完全不知道原因是什么。我真的很感激你的任何想法。
提前致谢!
Some users of my app have reported crashes occurring only when opening the app after a firmware upgrade to iOS 5. Everything was fine prior to the firmware upgrade - including running the app and upgrading to a newer version of the app and then running it.
The crash log indicates the crash is occurring when a NIB is loaded:
0 CoreFoundation 0x32bb38bf __exceptionPreprocess + 163
1 libobjc.A.dylib 0x36a1d1e5 objc_exception_throw + 33
2 CoreFoundation 0x32bb37b9 +[NSException raise:format:] + 1
3 CoreFoundation 0x32bb37db +[NSException raise:format:] + 35
4 UIKit 0x3169a747 -[UINib instantiateWithOwner:options:] + 1567
5 UIKit 0x3160a9cb -[UIViewController _loadViewFromNibNamed:bundle:] + 247
6 UIKit 0x314e9ea1 -[UIViewController loadView] + 89
7 UIKit 0x3145f78b -[UIViewController view] + 51
8 UIKit 0x3146bc39 -[UIViewController contentScrollView] + 25
9 UIKit 0x3146baa9 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 37
10 UIKit 0x3146b98f -[UINavigationController _layoutViewController:] + 35
11 UIKit 0x3146b211 -[UINavigationController _startTransition:fromViewController:toViewController:] + 501
12 UIKit 0x3146af53 -[UINavigationController _startDeferredTransitionIfNeeded] + 251
13 UIKit 0x3145f673 -[UINavigationController pushViewController:transition:forceImmediate:] + 807
14 UIKit 0x3145f349 -[UINavigationController pushViewController:animated:] + 37
For some reason, deleting and reinstalling the app after the iOS 5 firmware upgrade seems to resolve the issue.
I'm utterly baffled as to what the cause could be. I'd really appreciate any thoughts you may have.
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在许多应用程序中观察到这种行为。我最好的猜测是,它试图通过序列化包加载以前的界面状态作为 -[UIViewController _loadViewFromNibNamed:bundle:] 的参数,但包类有人改变了它在 4 和 5 之间的序列化方式。
I've observed this behavior in many apps. My best guess is that it's trying to load previous interface state through a serialized bundle as the argument of -[UIViewController _loadViewFromNibNamed:bundle:], but that the bundle class has someone changed how it serializes between 4 and 5.
看起来 Apple 改变了反序列化 NIB 的方式。我已更改为使用未编译的 NIB 来交付,而不是使用已编译的 NIB 来交付。再次编译 NIB 解决了这个问题。
Looks like Apple changed how they de-serialize NIBs. I had changed to shipping with uncompiled NIBs instead of shipping with compiled NIBs. Compiling NIBs again fixed the problem.