Re: Setting action: with a variable
Re: Setting action: with a variable
- Subject: Re: Setting action: with a variable
- From: Jens Alfke <email@hidden>
- Date: Tue, 27 May 2008 09:21:44 -0700
On 27 May '08, at 9:04 AM, Mark Manes wrote:
[aButton addTarget:self action:variable ....]
I don't think there is a standard addTarget:action: method. It's not
showing up in the Xcode doc viewer. Did you define that yourself?
Normally you use setTarget: and setAction: on NSControls.
- (void) setAction: (SEL)action;
Actions are selectors, which are of type SEL. (SEL is not an object,
but a magic Obj-C data structure that happens to look like a C
string.) You generate SEL literals using the syntax @selector(...). Or
you can use the functions NSSelectorFromString and
NSStringFromSelector to convert to/from regular string objects.
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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