感谢您抽出一些时间来阅读我的问题。 我有这个应用程序(在苹果蠹),其中约有10%的用户与iOS 3.0,所以我想在我的下一次更新中支持他们。加载主XIB使iOS 3.0上的应用程序崩溃
我使用运行iOS 4.0和5.0.1的实际设备对其进行了测试;它工作得很好。但在iOS 3.0崩溃与一个例外:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' -[NSKeyedUnarchiver initForReadingWithData:]: incomprehensible archive (0x4e, 0x49, 0x42, 0x41, 0x72, 0x63, 0x68, 0x69)
显然加载主XIB的时候,这里的异常回溯:
0 0x30016588 in objc_exception_throw()
1 0x30224026 in +[NSException raise:format:arguments:]()
2 0x30223fc6 in +[NSException raise:format:]()
3 0x305564b4 in -[NSKeyedUnarchiver initForReadingWithData:]()
4 0x3094927c in -[UINib instantiateWithOptions:owner:loadingResourcesFromBundle:]()
5 0x30949090 in -[NSBundle(NSBundleAdditions) loadNibNamed:owner:options:]()
6 0x308f131c in -[UIApplication _loadMainNibFile]()
7 0x308f0f9c in -[UIApplication _runWithURL:sourceBundleID:]()
8 0x309374b0 in -[UIApplication handleEvent:withNewEvent:]()
9 0x30936cf0 in -[UIApplication sendEvent:]()
10 0x3093687c in _UIApplicationHandleEvent()
11 0x3204696c in PurpleEventCallback()
12 0x30254a76 in CFRunLoopRunSpecific()
13 0x3025416a in CFRunLoopRunInMode()
14 0x308f0354 in -[UIApplication _run]()
15 0x308eea94 in UIApplicationMain()
16 0x00003886 in main (argc=1, argv=0x2ffff74c)
我已阅读并试图this和this。因此,我将所有的部署版本设置为3.0,并开发到Interface Builder 3.0,但仍然没有运气。
你有一个旧的XCode SDK?你有没有试过用这种sdk的InterfaceBuilder打开笔尖? – 2012-03-05 09:19:11
感谢@Peter,我认为有一些进展,我遵循了你的建议,幸运的是我有权访问Xcode 3.2,我在那里编译我的项目,经过一些修复后,它可以在iOS 3.0设备上运行,然后我复制了精确的同样的项目到Xcode 4.2,我从以前得到同样的错误,我想这是关于新的Xcode编译项目的方式。 – Emanuel 2012-03-05 20:01:42
我不是100%确定,但我认为我已经阅读过某些地方,xcode 4.2笔尖只能向下兼容到iOS 3.2。我试着将最小需求目标设置为3.2 - 或者尝试使用用旧sdk创建的nib而不用在XCode 4.2中重新编译它们。 – 2012-03-06 04:55:52