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 (Cocoa-dev@lists.apple.com)

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/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to