我有一个使用 Xcode 版本 4.5.1 开发的 iOS 应用程序。我的 iOS 部署目标设置为 5.0,因为我希望应用程序在 iOS 5.0、5.1 和 6.0 上运行。
当我在 iOS 6 设备(或模拟器)上运行应用程序时,一切正常。当我在 iOS 5 设备(或模拟器)上运行应用程序时,应用程序在 UIApplicationMain 中崩溃。我可以一步一步通过 application:didFinishLaunchingWithOptions: 并且它似乎正在成功执行。这是堆栈跟踪:
如果有帮助,这里是寄存器:
(lldb) register read
General Purpose Registers:
eax = 0x06e5f590
ebx = 0x01226f9c "class"
ecx = 0x0733fb8c
edx = 0x0733fb90
edi = 0x0011d814 (void *)0x0011d800: TRAppDelegate
esi = 0xbffff310
ebp = 0xbffff2e8
esp = 0xbffff2a0
eflags = 0x00000286
eip = 0x00002b3d Messenger`main + 141 at main.m:16
6 registers were unavailable.
(lldb)
回溯:
(lldb) bt
* thread #1: tid = 0x1c03, 0x01211caa libobjc.A.dylib`objc_exception_throw, stop reason = breakpoint 1.3 2.3
frame #0: 0x01211caa libobjc.A.dylib`objc_exception_throw
frame #1: 0x015cda48 CoreFoundation`+[NSException raise:format:arguments:] + 136
frame #2: 0x015cd9b9 CoreFoundation`+[NSException raise:format:] + 57
frame #3: 0x006954a3 UIKit`UINibDecoderDecodeObjectForValue + 281
frame #4: 0x0069567b UIKit`UINibDecoderDecodeObjectForValue + 753
frame #5: 0x00695383 UIKit`-[UINibDecoder decodeObjectForKey:] + 117
frame #6: 0x0059516d UIKit`-[UINib instantiateWithOwner:options:] + 921
frame #7: 0x0043b1fc UIKit`-[UIViewController _loadViewFromNibNamed:bundle:] + 286
frame #8: 0x0043b779 UIKit`-[UIViewController loadView] + 302
frame #9: 0x0043b99b UIKit`-[UIViewController view] + 53
frame #10: 0x0039a401 UIKit`-[UIWindow addRootViewControllerViewIfPossible] + 45
frame #11: 0x0039a670 UIKit`-[UIWindow _setHidden:forced:] + 280
frame #12: 0x0039a836 UIKit`-[UIWindow _orderFrontWithoutMakingKey] + 49
frame #13: 0x003a172a UIKit`-[UIWindow makeKeyAndVisible] + 35
frame #14: 0x00372596 UIKit`-[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1820
frame #15: 0x00373274 UIKit`-[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 524
frame #16: 0x00382183 UIKit`-[UIApplication handleEvent:withNewEvent:] + 1027
frame #17: 0x00382c38 UIKit`-[UIApplication sendEvent:] + 68
frame #18: 0x00376634 UIKit`_UIApplicationHandleEvent + 8196
frame #19: 0x02314ef5 GraphicsServices`PurpleEventCallback + 1274
frame #20: 0x015f9195 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
frame #21: 0x0155dff2 CoreFoundation`__CFRunLoopDoSource1 + 146
frame #22: 0x0155c8da CoreFoundation`__CFRunLoopRun + 2218
frame #23: 0x0155bd84 CoreFoundation`CFRunLoopRunSpecific + 212
frame #24: 0x0155bc9b CoreFoundation`CFRunLoopRunInMode + 123
frame #25: 0x00372c65 UIKit`-[UIApplication _run] + 576
frame #26: 0x00374626 UIKit`UIApplicationMain + 1163
frame #27: 0x00002b3d Messenger`main + 141 at main.m:16
(lldb)
问题
- 知道这里可能会发生什么吗?
- 是否可以使用 Xcode 4.5 开发 iOS 5 应用程序?我认为答案是肯定的。
- 如何查看寄存器的内容?我试过从这里看一些东西,但没有看到任何有用的东西。
- 我应该关注哪些寄存器?
- 我应该问我没有问的问题是什么?
解决方案:
禁用自动布局