Ben Packard
Ben Packard

Reputation: 26516

Multiple IBActions for a single UI event

I'm a bit embarrassed to ask this one... if I want two very different things to happen when, say, a UIButton is used, can I hook this up in Interface Builder? I can't find a way to add multiple actions to the event.

The obvious answer is to have a single action connected, and perform both methods in the same block of code. But I quite liked the button action being connected to 'saveItem' instead of some generic 'buttonPressed' method.

I suppose I could also add the actions in code.

Upvotes: 2

Views: 309

Answers (1)

Andrew Madsen
Andrew Madsen

Reputation: 21383

Unfortunately, there's not a way to do this with the builtin UI classes. You'll have to hook up to a single IBAction, then call through to the methods you want to call.

Upvotes: 3

Related Questions