解决ARC下performselector-may-cause-a-leak-because-its-selector-is-unknown 警告
生活随笔
收集整理的這篇文章主要介紹了
解决ARC下performselector-may-cause-a-leak-because-its-selector-is-unknown 警告
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
在ARC下使用?
[theTarget performSelector:theTarget withObject:Nil];會出現警告:performselector-may-cause-a-leak-because-its-selector-is-unknown?
解決方法:
1:添加如下宏
#define SuppressPerformSelectorLeakWarning(Stuff) \ do { \ _Pragma("clang diagnostic push") \ _Pragma("clang diagnostic ignored \"-Warc-performSelector-leaks\"") \ Stuff; \ _Pragma("clang diagnostic pop") \ } while (0)2:使用宏
SuppressPerformSelectorLeakWarning([theTarget performSelector:theAction withObject:@"hello"]);
參考:http://stackoverflow.com/questions/7017281/performselector-may-cause-a-leak-because-its-selector-is-unknown
轉載于:https://www.cnblogs.com/cocoajin/p/3402023.html
總結
以上是生活随笔為你收集整理的解决ARC下performselector-may-cause-a-leak-because-its-selector-is-unknown 警告的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Cisco OSPF NSSA区域配置
- 下一篇: SQL 笔记汇总