• 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
Re: Setting action: with a variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Setting action: with a variable (From: Mark Manes <email@hidden>)

  • Prev by Date: Re: Setting action: with a variable
  • Next by Date: Re: Date compiled?
  • Previous by thread: Re: Setting action: with a variable
  • Next by thread: Re: Setting action: with a variable
  • Index(es):
    • Date
    • Thread