Re: ObjC Question - labeled arguments
Re: ObjC Question - labeled arguments
- Subject: Re: ObjC Question - labeled arguments
- From: Peter Zegelin <email@hidden>
- Date: Thu, 22 May 2008 17:02:51 +1000
Um - hangs head in embarrassment.
It compiles but indeed it doesn't work (unrecognized selector ). After
I got it to compile I thought Aha! not realizing the confusion my
little question about labeled arguments would cause.
Sorry about that - I'm flabbergasted that I have got so far with so
little understanding!!
Peter
Sorry also about the mail mixup :-(
On 22/05/2008, at 4:33 PM, Jens Alfke wrote:
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_______________________________________________
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
_______________________________________________
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