Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ObjC Question - labeled arguments




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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >ObjC Question - labeled arguments (From: Peter Zegelin <email@hidden>)
 >Re: ObjC Question - labeled arguments (From: mmalc crawford <email@hidden>)
 >Re: ObjC Question - labeled arguments (From: Peter Zegelin <email@hidden>)
 >Re: ObjC Question - labeled arguments (From: "Michael Ash" <email@hidden>)
 >Re: ObjC Question - labeled arguments (From: Roland King <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.