I'm new to Objective C and I'm going through a tutorial I found online. The tutorial starts to talk about messaging and argument separation and gives an example:
When there's more than one argument, they're declared within the method name after the colons. Arguments break the name apart in the declaration, just as in a message.
- (void)setWidth:(float)width: height:(float)height;
I don't think there is suppose to be a colon after width, but I could be wrong. From what I've researched, I believe that it's a typo, but since I am new I just wanted to check.
Is the method just setWidth: height: ? Or is there another argument after the (float)width other than height:(float)height?
It's a typo. The method signature should read:
- (void)setWidth:(float)width height:(float)height;
The method name is setWidth:height: and you would call it like this:
[someObject setWidth:aFloat height:anotherFloat];
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