在一台用户 10.6.8 机器上崩溃,并将无法识别的选择器发送到班级
2011-07-30 18:59:33.545 TokenLock[481:903] +[IOBluetoothDevice deviceWithAddress:]: unrecognized selector sent to class 0x7fff70c18cf8
2011-07-30 18:59:33.546 TokenLock[481:903] An uncaught exception was raised
2011-07-30 18:59:33.547 TokenLock[481:903] +[IOBluetoothDevice deviceWithAddress:]: unrecognized selector sent to class 0x7fff70c18cf8
2011-07-30 18:59:33.548 TokenLock[481:903] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[IOBluetoothDevice deviceWithAddress:]: unrecognized selector sent to class 0x7fff70c18cf8'
实际代码:
BluetoothDeviceAddress addr;
IOBluetoothNSStringToDeviceAddress(selectedBTDeviceSerial, &addr);
actualBTDevice = [[IOBluetoothDevice alloc] init];
actualBTDevice = [IOBluetoothDevice deviceWithAddress:&addr];
关于如何排除故障或让他重新安装 IOBluetooth 系统的东西有什么想法吗?
2011-07-30 18:59:33.545 TokenLock[481:903] +[IOBluetoothDevice deviceWithAddress:]: unrecognized selector sent to class 0x7fff70c18cf8
2011-07-30 18:59:33.546 TokenLock[481:903] An uncaught exception was raised
2011-07-30 18:59:33.547 TokenLock[481:903] +[IOBluetoothDevice deviceWithAddress:]: unrecognized selector sent to class 0x7fff70c18cf8
2011-07-30 18:59:33.548 TokenLock[481:903] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[IOBluetoothDevice deviceWithAddress:]: unrecognized selector sent to class 0x7fff70c18cf8'
Actual code:
BluetoothDeviceAddress addr;
IOBluetoothNSStringToDeviceAddress(selectedBTDeviceSerial, &addr);
actualBTDevice = [[IOBluetoothDevice alloc] init];
actualBTDevice = [IOBluetoothDevice deviceWithAddress:&addr];
Any ideas on how to troubleshoot, or have him reinstall the IOBluetooth system stuff?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
+[IOBluetoothDevice deviceWithAddress:]
是在 Mac OS X v10.7 SDK 中引入的。早期的 OS X 版本提供+[IOBluetoothDevice withAddress:]
。您应该能够执行类似的操作:此外,您正在泄漏正在实例化的对象,
因为您立即将另一个对象分配给该变量。
+[IOBluetoothDevice deviceWithAddress:]
was introduced in the Mac OS X v10.7 SDK. Earlier OS X versions provide+[IOBluetoothDevice withAddress:]
instead. You should be able to do something like:Also, you’re leaking the object you’re instantiating with
since you’re immediately assigning another object to that variable.