I'm thinking the method name is setWidth with two arguments, one
unlabeled and the other labeled with 'height'.
Nope. The method name (also called the "selector") is all of the
keywords concatenated together. So in your example the method name is
"setWidth:height:".
I can see that coming from a C-style syntax you'd be thinking of the
first keyword as being different from the rest and calling it the
method name, but it's not. All the keywords are equal.
Other examples of a call and the method name:
[foo bar] --> bar
[foo bar: 1] --> bar:
[foo bar: 1 baz: 2] --> bar:baz:
These are all entirely different method names. The second and third
kind of look as though 'baz:' is an optional parameter, but it doesn't
work that way. You have to implement all the methods separately. (And
note that you could have a baz: method too, which looks as though the
_first_ parameter were optional. Try that in C++!)
Try to avoid using unnamed keywords. The language may still support
them, but they're obsolete and deprecated, and you'll hardly find any
methods in any Cocoa API that use them.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden
This email sent to email@hidden