• 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
Programmatically setting action of a button
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Programmatically setting action of a button


  • Subject: Programmatically setting action of a button
  • From: Matthias Winkelmann <email@hidden>
  • Date: Tue, 28 Feb 2006 13:16:13 +0100

Hi,

I'm having a little problem with setting the action for a button. I have a custom view which adds some buttons like this:

NSButton *newButton = [[NSButton alloc] initWithFrame:frame];
[newButton setTitle:caption];
[newButton setImage:newImage];
[newButton setAction:@selector(someAction:)];
[self addSubview:newButton];

In the same class I added someAction:

- (IBAction)someAction:(id)sender;

The buttons are rendered correctly, but the Action is apparently never called. Any ideas?

thanks,

Matthias _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: Programmatically setting action of a button
      • From: email@hidden
  • Prev by Date: Re: Problem with copiesOnScroll of NSClipView
  • Next by Date: Re: Programmatically setting action of a button
  • Previous by thread: Help in Sketch
  • Next by thread: Re: Programmatically setting action of a button
  • Index(es):
    • Date
    • Thread