in this sample method/message:
-(void) setNumerator:(int) n {
numerator = n;
}
What does the (int) mean? It doesn't look like its casting to an int...
int refers to the type of n. When sending the -setNumerator: message, you need to supply an argument. In this case you would supply an argument of type int.
if your method had a definition like:
- (void)setNumerator:(NSNumber *)n {
NSNumber *newNumerator = [n copy];
[numerator release];
numerator = newNumerator;
}
you would then supply an NSNumber when sending -setNumerator:.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With