标签:ios performselector may cause a leak selector is unknown leak
本人使用的方法,需要针对每个warning进行添加
#pragma clang diagnostic push #pragma clang diagnostic ignored "-Warc-performSelector-leaks" id value = [weakSelf performSelector:getSel];//产生warning的代码 #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] );
版权声明:本文为博主原创文章,未经博主允许不得转载。
PerformSelector may cause a leak because its selector is unknown
标签:ios performselector may cause a leak selector is unknown leak
原文地址:http://blog.csdn.net/u011439689/article/details/47401583