performSelector可能會致使泄漏,由於其選擇器未知 - performSelector may cause a leak because its selector is unknown

問題:

I'm getting the following warning by the ARC compiler: ARC編譯器收到如下警告: this

"performSelector may cause a leak because its selector is unknown".

Here's what I'm doing: 這是我在作什麼: spa

[_controller performSelector:NSSelectorFromString(@"someMethod")];

Why do I get this warning? 爲何會收到此警告? I understand the compiler can't check if the selector exists or not, but why would that cause a leak? 我知道編譯器沒法檢查選擇器是否存在,可是爲何會致使泄漏? And how can I change my code so that I don't get this warning anymore? 以及如何更改個人代碼,以便再也不收到此警告? .net


解決方案:

參考一: https://stackoom.com/question/TRVx/performSelector可能會致使泄漏-由於其選擇器未知
參考二: https://oldbug.net/q/TRVx/performSelector-may-cause-a-leak-because-its-selector-is-unknown
相關文章
相關標籤/搜索