• 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: Peter Zegelin <email@hidden>
  • Date: Thu, 22 May 2008 14:48:41 +1000

New(ish) here.

After all the talk about the best way to learn Cocoa I thought I'd better brush up on my obj-c. I've been able to get an amazing distance without really understanding a lot as I am mainly using Cocoa as a gui around some C++ code and have been able to get a long way just by wiring things up in IB and reusing some example code. However when messaging an object with multiple parameters I have never been able to use labeled arguments - only unlabeled. However on a hunch I removed the first label and it worked.

Here is the method I was trying to call:

- (void)reset:(RulerStyle*)newStyle:(int)newSide:(int)textLoc: (double)newScale;

I have been calling it like so:

[horizontalRuler reset:style:1:1:1.0];

trying to use:

[horizontalRuler reset newStyle:style newSide:2 textLoc:1 newScale:1.0];

obviously didn't work, but if I remove the first label:

[horizontalRuler reset:style newSide:2 textLoc:1 newScale:1.0];

it suddenly did.

So my question is - is there a way to include the first label? I note that the examples in the ObjectiveC manual seem to leave the first one out also:

[myRect setWidth:10.0 :15.0];  ---> [myRect setWidth:10.0 height:15.0];

thanks!






_______________________________________________

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: Graham Cox <email@hidden>
    • Re: ObjC Question - labeled arguments
      • From: mmalc crawford <email@hidden>
    • Re: ObjC Question - labeled arguments
      • From: Andrew Farmer <email@hidden>
  • Prev by Date: fundamental question: how do I call controller methods from other classes?
  • Next by Date: Re: Can't get file type code using [fileAttr valueForKey:NSFileHFSTypeCode]
  • Previous by thread: Re: fundamental question: how do I call controller methods from other classes?
  • Next by thread: Re: ObjC Question - labeled arguments
  • Index(es):
    • Date
    • Thread