【Objective-C】语法(2)带有参数的方法定义
【Objective-C】语法(二)带有参数的方法定义
转载注明源地址 http://blog.csdn.net/fried_potatoes
oc方法中,一个冒号对应一个参数。(冒号和前面的注释也属于方法名)
定义的时候
<pre name="code" class="objc">-(int )sum:(int)num :(int)num
可以在冒号之前加上注释 效果好很多
-(int )sumnum1:(int)num andnum2:(int)num调用的时候
[sumnum1:10 andnum2:5]
转载注明源地址 http://blog.csdn.net/fried_potatoes