PerformSelector may cause a leak because its selector is unknown
2015-08-10 17:20
441 查看
本人使用的方法,需要针对每个warning进行添加
---------------------------------另一种方法--------------------------------------
另附全局宏定义的方法,也需要处理每个warning,大同小异
#pragma clang diagnostic push #pragma clang diagnostic ignored "-Warc-performSelector-leaks" id value = [weakSelf performSelector:getSel];//产生warning的代码 #pragma clang diagnostic pop
---------------------------------另一种方法--------------------------------------
另附全局宏定义的方法,也需要处理每个warning,大同小异
#define SuppressPerformSelectorLeakWarning(Stuff) \ do { \ _Pragma("clang diagnostic push") \ _Pragma("clang diagnostic ignored \"-Warc-performSelector-leaks\"") \ Stuff; \ _Pragma("clang diagnostic pop") \ } while (0) //如果没有返回结果,可以直接按如下方式调用: SuppressPerformSelectorLeakWarning( [_target performSelector:_action withObject:self] ); //如果要返回结果,可以按如下方式调用: id result; SuppressPerformSelectorLeakWarning( result = [_target performSelector:_action withObject:self] );
相关文章推荐
- 海量数据相似度计算之simhash短文本查找
- zoj 2734 Exchange Cards(母函数 && DFS)
- Java 23种模式一点就通
- Unicode字符串
- 【Visual Basic】列表控件ListView的增删改查、模态对话框、禁止窗口调整大小
- ashx一般处理程序接收ajax传回的json字符串,并写入到数据库
- 使用国内镜像源来加速python pypi包的安装
- HDU 4185 Oil Skimming
- KLT 光流
- 百度地图使用笔记
- 工厂方法
- 例举函数指针和指针函数
- 海量数据相似度计算之simhash和海明距离
- 【暑期基础3】B HDU 2054 A == B ?
- POJ 1655 Balancing Act (树的重心)
- Andorid Animation and Graphics系列(一)
- 机器学习之从logistic到神经网络算法
- 包装类、String转为int、正则表达式
- FOR XML PATH
- HDU 2389 Rain on your Parade