Mailing Lists: Apple Mailing Lists

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

ObjC Question - labeled arguments



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

This email sent to 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.