我在我的ios应用程序中包含了crashlytics并通过企业分发。关于可达性,Crashlytics每天都在报告下面的崩溃。我用谷歌搜索,但没有得到导致这次崩溃的原因。
Fatal Exception: NSInvalidArgumentException
-[__NSMallocBlock__ reachabilityChanged:]: unrecognized selector sent to instance 0x1c5cdfc0
Thread : Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x316642a3 __exceptionPreprocess + 162
1 libobjc.A.dylib 0x3252297f objc_exception_throw + 30
2 CoreFoundation 0x31667e07 -[NSObject(NSObject) doesNotRecognizeSelector:] + 170
3 CoreFoundation 0x31666531 ___forwarding___ + 392
4 CoreFoundation 0x315bdf68 _CF_forwarding_prep_0 + 24
5 CoreFoundation 0x315b5037 _CFXNotificationPost + 1426
6 Foundation 0x3319ed91 -[NSNotificationCenter postNotificationName:object:userInfo:] + 72
7 Foundation 0x331a2853 -[NSNotificationCenter postNotificationName:object:] + 30
8 0x0005aee9 ReachabilityCallback (Reachability.m:94)
9 SystemConfiguration 0x30f5f161 reachPerform + 924
10 CoreFoundation 0x31639683 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
11 CoreFoundation 0x31638ee9 __CFRunLoopDoSources0 + 212
12 CoreFoundation 0x31637cb7 __CFRunLoopRun + 646
13 CoreFoundation 0x315aaebd CFRunLoopRunSpecific + 356
14 CoreFoundation 0x315aad49 CFRunLoopRunInMode + 104
15 GraphicsServices 0x393a82eb GSEventRunModal + 74
16 UIKit 0x38e662f9 UIApplicationMain + 1120
17 0x00076f2f main (main.m:16)
18 libdyld.dylib 0x350bab20 start
答案 0 :(得分:1)
看起来您正在注册一个正在被解除分配的可达性观察者,但在此之前不会将自己作为观察者移除。因此,当稍后发布可达性通知时,它将被发送到解除分配的实例(即随机存储器位置),并且您会崩溃。
所有观察者(无论是可达性还是带有NSNotificationCenter
的任何其他通知)都应在取消分配之前将自己作为观察者移除。