我想知道:使用冒号编写选择器名称与无冒号@selector(mySelector)
或@selector(mySelector:)
有什么区别?使用冒号:或不使用选择器
如:
UIBarButtonItem *addButton = [[UIBarButtonItem alloc]initWith...
target:self
action:@selector(addAction:)];
我无法找到另一个例子没有冒号,但我敢肯定我已经看到了其中的一些。
冒号意味着有一个参数,没有冒号意味着这段作品后面没有参数。 –
[Objective-C performSelector - 何时使用冒号]的可能重复(http://stackoverflow.com/questions/1546372/objective-c-performselector-when-to-use-colon); [何时使用冒号与选择器](http://stackoverflow.com/questions/4953623/when-to-use-a-colon-with-a-selector) –
好的谢谢你的回答 – Paul