在我的应用程序中,我看到不少崩溃与下面的堆栈跟踪,在生产中。应用程序与[BTAlert解雇动画:]无法识别的选择器崩溃
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[BTAlert dismissAnimated:]: unrecognized selector sent to instance 0x15f6d500'
Application Specific Backtrace 1:
0 CoreFoundation 0x2f57cf03 <redacted> + 130
1 libobjc.A.dylib 0x39d11ce7 _objc_exception_throw + 38
2 CoreFoundation 0x2f580837 -[NSObject doesNotRecognizeSelector:] + 202
3 CoreFoundation 0x2f57f12f <redacted> + 706
4 CoreFoundation 0x2f4ce0d8 __CF_forwarding_prep_0 + 24
5 CoreBluetooth 0x2f2a508f -[BTDevicePicker dealloc] + 358
6 libobjc.A.dylib 0x39d20b6b <redacted> + 174
7 ExternalAccessory 0x2fe93105 <redacted> + 56
8 ExternalAccessory 0x2fe8b057 <redacted> + 898
9 CoreFoundation 0x2f53ef39 <redacted> + 12
10 CoreFoundation 0x2f4b2de9 __CFXNotificationPost + 1720
11 Foundation 0x2fe9dcc5 -[NSNotificationCenter postNotificationName:object:userInfo:] + 72
12 AppSupport 0x32f7b3f7 -[CPDistributedNotificationCenter deliverNotification:userInfo:] + 62
13 AppSupport 0x32f7b511 __CPDNDeliverNotification + 276
14 AppSupport 0x32f7a8a3 <redacted> + 138
15 AppSupport 0x32f6efb3 <redacted> + 146
16 CoreFoundation 0x2f54783f <redacted> + 34
17 CoreFoundation 0x2f5477db <redacted> + 346
18 CoreFoundation 0x2f545fa7 <redacted> + 1406
19 CoreFoundation 0x2f4b07a9 _CFRunLoopRunSpecific + 524
20 CoreFoundation 0x2f4b058b _CFRunLoopRunInMode + 106
21 GraphicsServices 0x3441d6d3 _GSEventRunModal + 138
22 UIKit 0x31e0f891 _UIApplicationMain + 1136
23 myapp 0x00102647 __mh_execute_header + 30279
24 libdyld.dylib 0x3a20fab7 <redacted> + 2
在我的应用程序中,我显示一个Bluetooth拾取器对话框,我猜测这个对话框关闭时会发生崩溃。我一直无法自己重现这次事故。我用于展示对话框的代码非常简单。
[[EAAccessoryManager sharedAccessoryManager] showBluetoothAccessoryPickerWithNameFilter:
[NSPredicate predicateWithFormat:@"SELF CONTAINS 'MyDeviceName'"]
completion:^(NSError *error) {
if (error) {
DLog(@"Failed to search for blueetoh devices or user cancelled %@", [error localizedDescription]);
} else {
[self userDidConnectToBTFromInApp];
}
}];
我的猜测是它有事情做与BTPicker被释放的解雇方法被调用之前 - 但是,这只是一个猜测。
我已经看到几乎任何类型的iPhone或iPad,以及几乎任何版本的iOS 6和7(包括7.1)的崩溃。
如果任何人有一个想法,为什么发生这种情况,我会很高兴听到这件事:
什么是'BTAlert'? 'dismissAnimated:'是一个'BTDatePicker'方法而不是'BTAlert'方法。有你的问题,''dismissAnimated:'在'BTAlert'上被调用,而不是在'BTDatePicker'上。如果你没有调用我不相信你的'BTAlert',那么可以把它和框架的开发者一起提出来,你可以在'ejazz'的答案中找到它。 – Popeye
从头看起来像'dismissAnimated:'是BTDevicePicker上的一种方法,这可能就是你的意思。我的猜测是该方法是在错误的对象上调用的,因为BTDevicePicker已经被释放。我相信在类似的情况下我曾经见过这种症状。我不知道的是,如果有什么我可以做,以防止这种情况。 – Soren
对不起,当写这些时非常疲惫。 – Popeye