2014-03-13 36 views
0

在我的应用程序中,我看到不少崩溃与下面的堆栈跟踪,在生产中。应用程序与[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)的崩溃。

如果任何人有一个想法,为什么发生这种情况,我会很高兴听到这件事:

+0

什么是'BTAlert'? 'dismissAnimated:'是一个'BTDatePicker'方法而不是'BTAlert'方法。有你的问题,''dismissAnimated:'在'BTAlert'上被调用,而不是在'BTDatePicker'上。如果你没有调用我不相信你的'BTAlert',那么可以把它和框架的开发者一起提出来,你可以在'ejazz'的答案中找到它。 – Popeye

+0

从头看起来像'dismissAnimated:'是BTDevicePicker上的一种方法,这可能就是你的意思。我的猜测是该方法是在错误的对象上调用的,因为BTDevicePicker已经被释放。我相信在类似的情况下我曾经见过这种症状。我不知道的是,如果有什么我可以做,以防止这种情况。 – Soren

+0

对不起,当写这些时非常疲惫。 – Popeye

回答

0

它可能有一些做的一个委托函数,见https://github.com/nst/iOS-Runtime-Headers/blob/master/Frameworks/CoreBluetooth.framework/BTDevicePicker.h

它试图调用该函数,我认为。

其他可能的事情是,您正在使用的方法即> iOs6,并且崩溃发生在iOs 5.您能检查吗?

+0

谢谢。我已经用更多的上下文更新了我的答案。用于显示选择器的API非常封闭,除了从我的示例代码中知道的内容外,没有什么可以做的。 – Soren

+0

我唯一能想到的就是它可能要在不同的线程上运行。在Apple的演示应用程序(https://developer.apple.com/library/ios/samplecode/EADemo/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010079)中,EADSessionController中存在警告。 h':'//注意:EADSessionController不是线程安全的,调用不同线程的方法会导致不可预知的结果 – ejazz

相关问题