Note that there are some explanatory texts on larger screens.

plurals
  1. POCan I define a new outgoing action to connect in Interface Builder?
    text
    copied!<p>Ok, what I actually want to do is change the tab when a user presses a button in an AlertView I pop up.</p> <p>My custom FirstViewController creates the AlertView and sets itself as the delegate. I want FirstViewController to take some action, but then I also want to change the tab in my tab view interface. FirstViewController doesn't know about the tab interface at all. I could add a connection so that FirstViewController does know about it, but that seems inelegant to me.</p> <p>What I would like to do is define an outgoing action on FirstViewController, and be able to connect it in Interface Builder to an IBAction on some object outside FirstViewController that does know about the tab interface, maybe my app delegate, maybe another custom view controller I have called MenuViewController. Then I would call it from FirstViewController alertView:clickedButtonAtIndex:</p> <p>In my code I know how to create IBOutlets, outgoing connections to other objects. I know how to create IBActions, incoming action targets that other objects can call. What I want is to be able to create an "IBOutletAction", that I can point to an IBAction in another object. UIControls somehow define "IBOutletActions" that tell Interface Builder what events they have that can be connected to other objects' IBActions. Can I do the same thing, or is it achieved for UIControls by some secret mojo that only works for Apple classes? If I can't duplicate it exactly, what's your recommendation for the simplest approximation? I can define a -setTarget:(id)target forAction:(SEL)action on FirstViewController and link it up in code, but ideally I want something that can be set in Interface Builder.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload