Reputation: 1480
I am iOS developer and I want to develop a Mac app (it's basically a "port" from an iOS app). In IB in iOS is very easy to connect one UIButton to two or more actions. I have noticed that in a Mac App I only can connect a NSButton to a single action. Is there a way to connect an NSButton to more than one action?
Upvotes: 5
Views: 1406
Reputation: 46533
Is there a way to connect an NSButton to more than one action?
NO. This is not supported in OSX Cocoa applications.
You need to setAction:
yourself based on conditions, But only one at a time can be used.
In case you want to call two methods(actions), in the IBAction method you need to call them.
-(IBAction)multipleActions:(id)sender{
[self method1:sender];
[self method2:sender];
}
Upvotes: 4