我开始在我的iPhone应用程序中使用Crashlytics,似乎在启动时(或者我猜是启动时)对于某些用户会崩溃。以下是堆栈跟踪:
Fatal Exception: NSInvalidArgumentException
-[NSNull rangeOfCharacterFromSet:]: unrecognized selector sent to instance 0x19687eba0
Thread : Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x00000001854aa59c __exceptionPreprocess + 132
1 libobjc.A.dylib 0x0000000195bfc0e4 objc_exception_throw + 60
2 CoreFoundation 0x00000001854b1664 __methodDescriptionForSelector
3 CoreFoundation 0x00000001854ae418 ___forwarding___ + 928
4 CoreFoundation 0x00000001853b2b6c _CF_forwarding_prep_0 + 92
5 UIKit 0x0000000189fc38a0 -[UILabel _contentInsetsFromFonts] + 104
6 UIKit 0x000000018a13ac90 -[_UILabelLayer updateContentInsets] + 76
7 UIKit 0x000000018a13ad50 -[_UILabelLayer updateContentLayerSize] + 56
8 UIKit 0x000000018a13ae34 -[_UILabelLayer layoutSublayers] + 36
9 QuartzCore 0x00000001895ac564 CA::Layer::layout_if_needed(CA::Transaction*) + 320
10 QuartzCore 0x00000001895ac408 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 32
11 QuartzCore 0x00000001895abc08 CA::Context::commit_transaction(CA::Transaction*) + 276
12 QuartzCore 0x00000001895ab98c CA::Transaction::commit() + 436
13 QuartzCore 0x00000001895a53bc CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 80
14 CoreFoundation 0x0000000185462a50 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
15 CoreFoundation 0x000000018545f9dc __CFRunLoopDoObservers + 360
16 CoreFoundation 0x000000018545fdbc __CFRunLoopRun + 836
17 CoreFoundation 0x000000018538d0a4 CFRunLoopRunSpecific + 396
18 GraphicsServices 0x000000018e52f5a4 GSEventRunModal + 168
19 UIKit 0x0000000189cc23c0 UIApplicationMain + 1488
20 partybutton 0x00000001000d6de0 main (main.m:16)
21 libdyld.dylib 0x000000019626aa08 start + 4
我不太确定如何调试这个问题,因为我自己无法重现。有什么提示吗?
NSString
,但对于某些用户,服务器在该字段中发送了null
。因此,JSON解析器创建了一个NSNull
,您会看到指定的行为。 - Mats