简体   繁体   English

Apple Demo没有“ performSelector可能会导致泄漏,因为其选择器未知”警告。 有人知道为什么吗?

[英]Apple Demo don't have “performSelector may cause a leak because its selector is unknown” Warning. Anyone know why?

I'm getting the following warning by the ARC compiler: ARC编译器收到以下警告:

"performSelector may cause a leak because its selector is unknown". “ performSelector可能会导致泄漏,因为其选择器未知”。

Here's what I'm doing: 这是我在做什么:

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

But under Apple Demo , they don't have this Warning for the same code. 但是在Apple Demo下 ,对于相同的代码,他们没有此警告。 Anyone know why? 有人知道为什么吗?

That sample is not an ARC project. 该示例不是ARC项目。 The warning you cite is the default with ARC projects. 您引用的警告是ARC项目的默认警告。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM