@interface Calc : NSObject
//selector "sum::" with empty parts:
//legal, but names are the convention
- (int)sum:(int)n1 :(int)n2;
@end
@implementation Calc
- (int)sum:(int)n1 :(int)n2 {
return n1 + n2;
}
@end
Calc *calc = [Calc new];
int value = [calc sum:3 :2];
//value is 5