我正在遇到设备崩溃(从崩溃解决方案获取数据),这是我无法重新创建的。 也不是这次我可以从崩溃堆栈中找到它。 该应用程序是iOS7 +,并且在iOS7上发生了崩溃
致命异常:NSInvalidArgumentException - [NSAttributeDictionary textContainerForAttributedString:containerSize:lineFragmentPadding:]:无法识别的选择器发送到实例0x188c6820
Thread : Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x2f79becb __exceptionPreprocess + 130
1 libobjc.A.dylib 0x39f36ce7 objc_exception_throw + 38
2 CoreFoundation 0x2f79f7f7 -[NSObject(NSObject) doesNotRecognizeSelector:] + 202
3 CoreFoundation 0x2f79e0f7 ___forwarding___ + 706
4 CoreFoundation 0x2f6ed058 _CF_forwarding_prep_0 + 24
5 UIFoundation 0x3741e915 __NSStringDrawingEngine + 12252
6 UIFoundation 0x3741b863 -[NSString(NSExtendedStringDrawing) drawWithRect:options:attributes:context:] + 150
7 UIKit 0x31fe62a9 -[UILabel _drawTextInRect:baselineCalculationOnly:] + 4224
8 UIKit 0x3204c6e9 -[UILabel drawTextInRect:] + 500
9 UIKit 0x3204c4eb -[UILabel drawRect:] + 78
10 UIKit 0x3204c489 -[UIView(CALayerDelegate) drawLayer:inContext:] + 372
11 QuartzCore 0x31c78189 -[CALayer drawInContext:] + 100
12 QuartzCore 0x31c61c5b CABackingStoreUpdate_ + 1858
13 QuartzCore 0x31d3dc1d ___ZN2CA5Layer8display_Ev_block_invoke + 52
14 QuartzCore 0x31c6150b x_blame_allocations + 82
15 QuartzCore 0x31c611bf CA::Layer::display_() + 1118
16 QuartzCore 0x31c44d41 CA::Layer::display_if_needed(CA::Transaction*) + 208
17 QuartzCore 0x31c449d9 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 24
18 QuartzCore 0x31c443e5 CA::Context::commit_transaction(CA::Transaction*) + 228
19 QuartzCore 0x31c441f7 CA::Transaction::commit() + 314
20 QuartzCore 0x31c718e3 CA::Transaction::release_thread(void*) + 162
21 libsystem_pthread.dylib 0x3a5516d1 _pthread_tsd_cleanup + 164
22 libsystem_pthread.dylib 0x3a551453 _pthread_exit + 86
23 libsystem_pthread.dylib 0x3a5521b9 pthread_exit + 28
24 Foundation 0x300d9703 +[NSThread exit] + 10
25 Foundation 0x30185a2d __NSThread__main__ + 1092
26 libsystem_pthread.dylib 0x3a552959 _pthread_body + 140
27 libsystem_pthread.dylib 0x3a5528cb _pthread_start + 102
28 libsystem_pthread.dylib 0x3a550ae8 thread_start + 8
答案 0 :(得分:0)
通过查看注释,看起来您在尝试启动绘图功能时可能不在主线程上。您可能在某个单独的线程上执行动画或CATransaction。如果您碰巧知道应用程序中可能存在的位置,我建议您使用
将其丢弃到主线程上dispatch_async(dispatch_get_main_queue(), ^{
//perform any animation or main thread drawing code here
});