Re: ObjC Question - labeled arguments
Re: ObjC Question - labeled arguments
- Subject: Re: ObjC Question - labeled arguments
- From: Jens Alfke <email@hidden>
- Date: Wed, 21 May 2008 23:33:59 -0700
On 21 May '08, at 10:51 PM, Roland King wrote:
What I don't understand is why adding labels to the 3 unlabelled
arguments also works as the OP said does, his example was this
[horizontalRuler reset:style *newSide*:2 *textLoc*:1 *newScale*:
1.0];
surely the selector of the original is "reset::::" so how can you
even call it successfully by adding labels to the parameters? Does
Obj-C do something odd when you have unlabelled arguments and imply
a labelled argument version from the variable names?
I don't believe this would actually work. There must have been
something else going on. As you point out, "reset::::" and
"reset:newSide:textLoc:newScale:" are two entirely different
selectors, and there's nothing that would transform the first into the
second. (Especially since that transformation would be ambiguous, if
there are other methods on that class of the form "reset:_:_:_".)
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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:
This email sent to email@hidden