日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

解决ARC下performselector-may-cause-a-leak-because-its-selector-is-unknown 警告

發(fā)布時(shí)間:2025/3/21 57 豆豆
生活随笔 收集整理的這篇文章主要介紹了 解决ARC下performselector-may-cause-a-leak-because-its-selector-is-unknown 警告 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

在ARC下使用?

[theTarget performSelector:theTarget withObject:Nil];

會(huì)出現(xiàn)警告: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

轉(zhuǎn)載于:https://www.cnblogs.com/cocoajin/p/3402023.html

總結(jié)

以上是生活随笔為你收集整理的解决ARC下performselector-may-cause-a-leak-because-its-selector-is-unknown 警告的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。