• 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: (no subject)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (no subject)


  • Subject: Re: (no subject)
  • From: Graham Cox <email@hidden>
  • Date: Tue, 17 Jun 2008 11:33:27 +1000

You can set a different tag value for each button (in IB), then in the action method use -[sender tag] to get the value. Tags are just an integer number that most controls support and their use is entirely decided by the programmer - Cocoa doesn't use them.

Alternatively you can of course just have two different action methods, one for each button - very often this will be the cleaner solution.

hth,


Graham


On 17 Jun 2008, at 11:27 am, Angelo Chen wrote:

Hi,

I have following action, two NSButtons are linked to it, I'd like to test which button trigger the action in the code, any way to do this? thanks.


- (IBAction)doCopying:(id)sender { // how to determine which NSButton is clicked? }

Angelo


Yahoo! Mail具備一流的網上安全保護 功能,請前往 http://hk.antispam.yahoo.com/ 了解更多相關資訊!
_______________________________________________


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

_______________________________________________

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: 
 >(no subject) (From: Angelo Chen <email@hidden>)

  • Prev by Date: Re: (no subject)
  • Next by Date: Re: Newbie interface questions - multiple "modal" windows
  • Previous by thread: Re: (no subject)
  • Next by thread: Making conceptual documentation
  • Index(es):
    • Date
    • Thread