performSelector may cause a leak because its selector is unknown

后端 未结 19 2475
小蘑菇
小蘑菇 2020-11-22 01:54

I\'m getting the following warning by the ARC compiler:

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

Here\'s what

19条回答
  •  旧时难觅i
    2020-11-22 02:50

    As a workaround until the compiler allows overriding the warning, you can use the runtime

    objc_msgSend(_controller, NSSelectorFromString(@"someMethod"));

    instead of

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

    You'll have to

    #import 

提交回复
热议问题