Search code examples
xcodecocoacocoa-touchfirst-responder

What is the user defined action "type" for?


What does the "type" column do here?

enter image description here


Solution

  • You can add arbitrary actions that you can bind on the first responder. Actions are of the form:

    - (IBOutlet)someAction:(id)sender
    

    The sender is the UI element that caused that action to be called.

    However, it can be nicer to have a type there, so if you're only going to wire buttons to this action, you could set the type to UIButton and then you'd make the method like this.

    - (IBOutlet)someAction:(UIButton *)sender