2014-09-06 99 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