Tom Shen
Tom Shen

Reputation: 2028

How to add a action to NSButton by code

I know you can add action to UIButton like this:

[button addTarget:self action:@selecter(mySelector:) onControlEvent:UIControlEventTouchUpInside];

But how do you do it for OS X NSButton?

Upvotes: 1

Views: 415

Answers (1)

Tom Shen
Tom Shen

Reputation: 2028

Never mind, you can do this:

[button setAction:@selector(mySelector)];

Upvotes: 1

Related Questions