2014-09-06 100 views
0

我得到了用户设备中的崩溃(我在Crashalytics中看到它) 问题是,核心转储是所有iOS内部的东西。 我怎样才能看到我的代码的起源造成崩溃的画?确定在我的代码中发生崩溃的原因

Terminating app due to an uncaught exception 'NSInvalidArgumentException', reason: '-[NSAttributeDictionary textContainerForAttributedString:containerSize:lineFragmentPadding:]: unrecognized selector sent to instance 0x15dc7f20' 
0 CoreFoundation 0x30065f23 +154 
1 libobjc.A.dylib 0x3a7fcce7 objc_exception_throw+38 
2 CoreFoundation 0x30069837 +202 
3 CoreFoundation 0x30068137 +706 
4 CoreFoundation 0x2ffb7098 _CF_forwarding_prep_0+24 
5 UIFoundation 0x37ce5915 +12252 
6 UIFoundation 0x37ce2863 +150 
7 UIKit 0x328ae2c9 +4224 
8 UIKit 0x32914709 +500 
9 UIKit 0x3291450b +78 
10 UIKit 0x329144a9 +372 
11 QuartzCore 0x32540189 +100 
12 QuartzCore 0x32529c5b +1858 
13 QuartzCore 0x32605c1d +52 
14 QuartzCore 0x3252950b +82 
15 QuartzCore 0x325291bf +1118 
16 QuartzCore 0x3250cd41 +208 
17 QuartzCore 0x3250c9d9 +24 
18 QuartzCore 0x3250c3e5 +228 
19 QuartzCore 0x3250c1f7 +314 
20 QuartzCore 0x325398e3 +162 
21 libsystem_pthread.dylib 0x3ae176d1 +164 
22 libsystem_pthread.dylib 0x3ae17453 +86 
23 libsystem_pthread.dylib 0x3ae181b9 pthread_exit+28 
24 Foundation 0x309a2703 +10 
25 Foundation 0x30a4ea2d +1092 
26 libsystem_pthread.dylib 0x3ae18959 +140 
27 libsystem_pthread.dylib 0x3ae188cb _pthread_start+102 

**编辑** 一个不同的线程,在这种运行崩溃(这又没有给我提示到原来的点在我的代码)

Thread : Crashed: Thread 
0 libsystem_c.dylib    0x3ad6206a __abort + 101 
1 libsystem_c.dylib    0x3ad6206b __abort + 102 
2 libsystem_c.dylib    0x3ad62005 __abort 
3 libc++abi.dylib    0x3a1b098f abort_message + 74 
4 libc++abi.dylib    0x3a1c96e7 default_terminate_handler() + 254 
5 libobjc.A.dylib    0x3a7fcf7d _objc_terminate() + 192 
6 libc++abi.dylib    0x3a1c71b3 std::__terminate(void (*)()) + 78 
7 libc++abi.dylib    0x3a1c6a09 __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*) 
8 libobjc.A.dylib    0x3a7fcdbb objc_exception_throw + 250 
9 CoreFoundation     0x30069837 -[NSObject(NSObject) doesNotRecognizeSelector:] + 202 
10 CoreFoundation     0x30068137 ___forwarding___ + 706 
11 CoreFoundation     0x2ffb7098 _CF_forwarding_prep_0 + 24 
12 UIFoundation     0x37ce5915 __NSStringDrawingEngine + 12252 
13 UIFoundation     0x37ce2863 -[NSString(NSExtendedStringDrawing) drawWithRect:options:attributes:context:] + 150 
14 UIKit       0x328ae2c9 -[UILabel _drawTextInRect:baselineCalculationOnly:] + 4224 
15 UIKit       0x32914709 -[UILabel drawTextInRect:] + 500 
16 UIKit       0x3291450b -[UILabel drawRect:] + 78 
17 UIKit       0x329144a9 -[UIView(CALayerDelegate) drawLayer:inContext:] + 372 
18 QuartzCore      0x32540189 -[CALayer drawInContext:] + 100 
19 QuartzCore      0x32529c5b CABackingStoreUpdate_ + 1858 
20 QuartzCore      0x32605c1d ___ZN2CA5Layer8display_Ev_block_invoke + 52 
21 QuartzCore      0x3252950b x_blame_allocations + 82 
22 QuartzCore      0x325291bf CA::Layer::display_() + 1118 
23 QuartzCore      0x3250cd41 CA::Layer::display_if_needed(CA::Transaction*) + 208 
24 QuartzCore      0x3250c9d9 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 24 
25 QuartzCore      0x3250c3e5 CA::Context::commit_transaction(CA::Transaction*) + 228 
26 QuartzCore      0x3250c1f7 CA::Transaction::commit() + 314 
27 QuartzCore      0x325398e3 CA::Transaction::release_thread(void*) + 162 
28 libsystem_pthread.dylib  0x3ae176d1 _pthread_tsd_cleanup + 164 
29 libsystem_pthread.dylib  0x3ae17453 _pthread_exit + 86 
30 libsystem_pthread.dylib  0x3ae181b9 pthread_exit + 28 
31 Foundation      0x309a2703 +[NSThread exit] + 10 
32 Foundation      0x30a4ea2d __NSThread__main__ + 1092 
33 libsystem_pthread.dylib  0x3ae18959 _pthread_body + 140 
34 libsystem_pthread.dylib  0x3ae188cb _pthread_start + 102 
+0

原因:' - [NSAttributeDictionary textContainerForAttributedString:containerSize:lineFragmentPadding:]:无法识别的选择器发送到实例0x15dc7f20,因此你得到异常。 – sanjeet 2014-09-06 06:58:19

+0

在这里检查http://stackoverflow.com/questions/23949168/button-shape-on-device-iphone-setting-result-app-crash-if-its-off-app-worki – sanjeet 2014-09-06 07:01:11

+0

我看到了那一个。 ..我想知道如果我能找出哪个按钮/标签正在造成它... – Boaz 2014-09-06 07:06:40

回答

0

有什么不寻常的是,你只是在生产中而不是在开发中得到这个崩溃。这可能是由于测试不当造成的,但另一个可能的原因是对您正在使用的数据类型进行假设,而且这些数据在开发过程中很难复制。

JSON是一个常见和经典的例子,其中服务器可以提供一个魔术般地变成对象层次结构的字符串响应。然后代码假定顶级对象是一个字典或数组,并开始调用无法识别的方法。

就你而言,你在发布前没有正确测试。 (这并不真正提供答案,但我觉得你拥有一切你需要给自己提供答案的地方,如果你可以不用它的话)。

+0

你说的很对,我可能在我的代码中有一个bug,但是因为这个崩溃发生在数百个用户中的一个用户身上,并且试图在一个测试版本上模拟他的行为并没有重新创建问题 - 我想要一些帮助,看看我能否在我的代码中找出问题。讲座很不错,但StackOverflow应该是一个安全的环境来获得协助 – Boaz 2014-09-06 12:09:55

+0

在生产中而不是在测试中的崩溃通常是由于针对生产/优化与调试模式而编译的。应该总是测试为生产编译的版本。 – 2014-09-06 12:21:36