warning:performSelector may cause a leak because its selector is unknown
2015-10-28 10:33
344 查看
在使用 performSelector: withObject: 函数出现“performSelector may cause a leak because its
selector is unknown”。
主要是警告信息,在非ARC项目中没有这个警告。如果是在某一处修改只需要加入下列代码
如果在程序中多次使用可以设置一下宏
如果没有返回值
有返回值
selector is unknown”。
主要是警告信息,在非ARC项目中没有这个警告。如果是在某一处修改只需要加入下列代码
#pragma clang diagnostic push #pragma clang diagnostic ignored "-Warc-performSelector-leaks" [vcappear performSelector:selector withObject:nil]; #pragma clang diagnostic pop
如果在程序中多次使用可以设置一下宏
#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] );
相关文章推荐
- Unity3D 内存 释放
- jQuery源码分析之init方法
- POJ 1258
- Spring MVC 配置 druid 数据源实例
- 改变apache路径规则来实现隐藏真实路径
- 安装R以及Rserve
- web测试常用的用例及知识(全(6-11))
- 收藏下phpexcel常用的字体设置,颜色设置和单元格保护
- 游戏机制笔记——突发和渐进(二)
- MapRed程序map个数控制分析
- 9月国内网民上网高峰时段为晚上8点 比例增至6.36%
- AllowOverride以及Options相关指令
- Android之记录几个Uri的Intent.
- Java微信插件开发培训—10月28日 晚九点—腾讯课堂
- 一些常用的东西
- LintCode_Fizz Buzz
- Windows下Nginx+Tomcat整合的安装与配置
- iOS开发json解析串打包
- UINavigationViewController显示新页面后,隐藏下面的TabBar
- Spring整合Junit进行单元测试