ios CoreBluetooth 警告 is being dealloc'ed while pending connection
ios CoreBluetooth 警告 is being dealloc'ed while pending connection
CoreBluetooth[WARNING] <CBPeripheral: 0x1780a53a0 identifier = 3F8E69BD-BE87-215F-3ADD-64AE670BD750, Name = "Alert Notifictaion", state = connecting> is being dealloc'ed while pending connection
使用cb,去链接外部蓝牙设备时出现的警告;
解决方式一:
创建一个 strong 或 retain 的
@property (strong,nonatomic) CBPeripheral *connectingPeripheral;
在扫描到设备的代理里面
self.connectingPeripheral = peripheral;
存储设备;
解决方式二:
创建一个可变的数组用来保存发布的设备
discoverPeripherals = [[NSMutableArray alloc]init];
在扫描到设备的代理里面
//[discoverPeripherals addObject:peripheral];
//扫描到设备会进入方法
-(void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI{ NSLog(@"11当扫描到设备:%@",peripheral.name);
//[discoverPeripherals addObject:peripheral];
self.connectingPeripheral = peripheral;
[central connectPeripheral:peripheral options:nil];
}
参考:http://stackoverflow.com/questions/15846663/ios6-cbperipheral-is-being-dealloced-while-connecting
ios CoreBluetooth 警告 is being dealloc'ed while pending connection的更多相关文章
- iOS 去除警告 看我就够了
你是不是看着开发过程中出现的一堆的警告会心情一阵烦躁,别烦躁了,看完此文章,消除警告的小尾巴. 一.SVN 操作导致的警告 1.svn删除文件后报错 ”xx“is missing from worki ...
- iOS 在 ARC 环境下 dealloc 的使用、理解误区
iOS 在 ARC 环境下 dealloc 的使用.理解误区 太阳火神的漂亮人生 (http://blog.csdn.net/opengl_es) 本文遵循"署名-非商业用途-保持一致&qu ...
- ios deprecated 警告消除 强迫症的选择
#pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" ...
- IOS开发之内存管理--dealloc该写些什么
在非ARC开发环境中,dealloc是类释放前,清理内存的最后机会.到底那些变量和属性该释放呢,一些特殊的类(nstimer,observer)该怎么释放.需要注意的是不释放会引起内存泄露,过度释放也 ...
- iOS CoreBluetooth 教程
去App Store搜索并下载“LightBlue”这个App,对调试你的app和理解Core Bluetooth会很有帮助. ================================ Cor ...
- IOS开发 警告 All interface orientations must be supported unless the app requires full screen.
在IOS开发中遇到警告 All interface orientations must be supported unless the app requires full screen. 只要勾上R ...
- IOS内存警告处理
IPhone下每个app可用的内存是被限制的,如果一个app使用的内存超过20M,则系统会向该app发送Memory Warning消息.收到此消息后,app必须正确处理,否则可能出错或者出现内存泄露 ...
- iOS 取消警告
第一步找到要取消的警告类型 在相应的警告上右击->Reveal in Log 被选中的-Wdeprecated-declarations就是我们所要的警告类型了. -W是前缀,这个前缀表示的是 ...
- iOS - 解决警告“ld: Warning: Directory Not Found for Option”
有时候我们可能从项目中删除了某个目录.文件以后,编译出现警告信息: ld: warning: directory not found for option“XXXXXX” 具体类似下图: 很奇怪,为什 ...
随机推荐
- 用Maonry如何实现UIScrollView
一,使用UIScrollView 与其他View 布局不同的地方在于, ScrollView的高度/宽度不固定: ScrollView的高度和宽度由其内容决定(即 Scroll View 的 cont ...
- eclipse中LogCat有时不显示信息的简单解决办法
android的开发中,经常需要使用到LogCat查看打印的信息. 但是eclipse中的LagCat,有时会刷新不出打印的日志. 特别是在点击ClearLog按钮后,经常会出现上面说的这种情况. 一 ...
- BZOJ 2229 最小割
题目链接:http://61.187.179.132/JudgeOnline/problem.php?id=2229 题意:给定一个带权无向图.若干询问,每个询问回答有多少点对(s,t)满足s和t的最 ...
- UVA 437 十九 The Tower of Babylon
The Tower of Babylon Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Subm ...
- 禁止在 .NET Framework 中执行用户代码。启用 "clr enabled" 配置选项
exec sp_configure 'show advanced options', '1';goreconfigure;goexec sp_configure 'clr enabled', '1'g ...
- 字符串处理:ABAP中的正则表达式
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
- LIST动态表格画线(动态列)
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
- [SAP ABAP开发技术总结]ABAP读写、解析XML文件
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
- C#计算某一些任务的执行时间(消耗时间)
class Program { static void Main(string[] args) { System.Diagnostics.Stopwatch sw = new System.Diagn ...
- poj 1064 (二分+控制精度) && hdu 1551
链接:http://poj.org/problem?id=1064 Cable master Time Limit: 1000MS Memory Limit: 10000K Total Submi ...