ObjC Question - labeled arguments
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