Explanation of Cocoa @selector usage

前端 未结 6 2066
轮回少年
轮回少年 2021-01-30 14:50

I\'m new to Cocoa/Cocoa Touch, and working through a development book. I\'ve come across situations where the @selector() operator is used. I\'m a bit lost on how and when the

6条回答
  •  攒了一身酷
    2021-01-30 15:05

    @selector() is used each time you need to pass the name of a method as an argument to another method, a function or as a variable value. Passing directly the name doesn't work in objective-C.

提交回复
热议问题