How to get rid of the 'undeclared selector' warning

前端 未结 12 2193
伪装坚强ぢ
伪装坚强ぢ 2020-12-12 10:53

I want to use a selector on an NSObject instance without the need for an implemented protocol. For example, there\'s a category method that should set an error prop

12条回答
  •  渐次进展
    2020-12-12 11:26

    Another way to avoid this warning is to make sure your selector method looks like this:

    -(void) myMethod :(id) sender{
    }
    

    Don't forget "(id) sender" if you want to accept any sender or specify a type of a sender object if you prefer.

提交回复
热议问题