• 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
ObjC Question - labeled arguments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ObjC Question - labeled arguments


  • Subject: ObjC Question - labeled arguments
  • From: Johnny Lundy <email@hidden>
  • Date: Thu, 22 May 2008 02:20:18 -0400

You're correct - there is no first argument per se: it is part of the method selector, together they are called a "keyword."

http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/chapter_3_section_3.html

A message with a single argument affixes a colon to the selector name and puts the argument right after the colon. This construct is called a keyword ; a keyword ends with a colon, and an argument follows the colon. Thus we could diagram a message expression with a single argument (and assignment) as the following:

****If a message has multiple arguments, the selector has multiple keywords. A selector name includes all keywords****, including colons, but does not include anything else, such as return type or parameter types. A message expression with multiple keywords (plus assignment) could be diagrammed as follows:




Well now I'm a bit confused as I just used the same paragraph to show
that it does. Too much C++ thinking I guess. I'm thinking the method
name is setWidth with two arguments, one unlabeled and the other
labeled with 'height'. Any suggestions where I should brush up on this
- apart from the manual I'm looking at already?

thanks!

Peter

_______________________________________________

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


  • Follow-Ups:
    • Re: ObjC Question - labeled arguments
      • From: Bill Bumgarner <email@hidden>
  • Prev by Date: Re: ObjC Question - labeled arguments
  • Next by Date: Re: ObjC Question - labeled arguments
  • Previous by thread: Re: ObjC Question - labeled arguments
  • Next by thread: Re: ObjC Question - labeled arguments
  • Index(es):
    • Date
    • Thread