• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ObjC Question - labeled arguments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

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>)

  • Prev by Date: ObjC Question - labeled arguments
  • Next by Date: Re: creating a resource fork and writing raw bytes to it
  • Previous by thread: Re: ObjC Question - labeled arguments
  • Next by thread: Re: ObjC Question - labeled arguments
  • Index(es):
    • Date
    • Thread