我的许多用户都在下面的堆栈跟踪中获得了崩溃描述。 您可以阅读它似乎发生在应用程序启动时,如果我们没有考虑第28行的标准主要调用,它不涉及我们的任何方法。 我不知道如何解决这个错误,因为我无法重现它,下面的堆栈跟踪对我没用。
该错误仅出现在iOS9上(93%iOS9.2,4%iOS 9.1.0等) 也许有人知道在这种情况下该怎么办?
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x180911bd0 objc_msgSend + 16
1 Foundation 0x181b7b5f4 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] + 372
2 Foundation 0x181c2430c _NSSetPointValueAndNotify + 284
3 UIKit 0x18608e798 -[UIView(Geometry) _applyISEngineLayoutValues] + 656
4 UIKit 0x185f9b458 -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 136
5 CoreFoundation 0x181188370 __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 132
6 CoreFoundation 0x181188268 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 308
7 UIKit 0x185f89f8c -[UIView(Geometry) resizeSubviewsWithOldSize:] + 148
8 UIKit 0x18608e8e0 -[UIView(AdditionalLayoutSupport) _is_layout] + 128
9 UIKit 0x1862931f0 -[UIView(Hierarchy) _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 756
10 UIKit 0x185f7f778 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 656
11 QuartzCore 0x18398eb2c -[CALayer layoutSublayers] + 148
12 QuartzCore 0x183989738 CA::Layer::layout_if_needed(CA::Transaction*) + 292
13 QuartzCore 0x1839895f8 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 32
14 QuartzCore 0x183988c94 CA::Context::commit_transaction(CA::Transaction*) + 252
15 QuartzCore 0x1839889dc CA::Transaction::commit() + 512
16 QuartzCore 0x1839820cc CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 80
17 CoreFoundation 0x181248588 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
18 CoreFoundation 0x18124632c __CFRunLoopDoObservers + 372
19 CoreFoundation 0x18124675c __CFRunLoopRun + 928
20 CoreFoundation 0x181175680 CFRunLoopRunSpecific + 384
21 GraphicsServices 0x182684088 GSEventRunModal + 180
22 UIKit 0x185fecd90 UIApplicationMain + 204
23 once 0x1000f0f00 main (main.m:14)
24 libdispatch.dylib 0x180d168b8 (Missing)
作为我使用AFNetworking的附加信息。这是AFNetworking线程堆栈跟踪,不会崩溃:
Thread : AFNetworking
0 libsystem_kernel.dylib 0x180e194bc mach_msg_trap + 8
1 libsystem_kernel.dylib 0x180e19338 mach_msg + 72
2 CoreFoundation 0x181248ac0 __CFRunLoopServiceMachPort + 196
3 CoreFoundation 0x1812467c4 __CFRunLoopRun + 1032
4 CoreFoundation 0x181175680 CFRunLoopRunSpecific + 384
5 Foundation 0x181b6d21c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 308
6 Foundation 0x181bc2874 -[NSRunLoop(NSRunLoop) run] + 88
7 once 0x1001ddf9c +[AFURLConnectionOperation networkRequestThreadEntryPoint:] (AFURLConnectionOperation.m:169)
8 Foundation 0x181c53c40 __NSThread__start__ + 1000
9 libsystem_pthread.dylib 0x180efbb28 _pthread_body + 156
也许它可以提供帮助 谢谢你的帮助!
答案 0 :(得分:0)
我在SO中找到了另一个条目,其堆栈与你的类似。有一个解决方案涉及在子视图中删除setTranslatesAutoresizingMaskIntoConstraints:NO。
在应用程序启动时,如果您有一个xib / storyboard,它只能是您的主视图控制器或launchScreen。