Search code examples
macoscocoainterface-buildercocoa-bindings

Interface Builder for Dummies: how to set the action of my button to "selectNext"?


I am in "the Binding Inspector" of my button, but I don't know how to put the right information.

IB

  • I guess I have to enter information only for "Target" (not for Argument
  • I bind it to "Array Controller"

But then ? I have the choice between four subsections, and don't know which one to choose !

  • Controller Key ???
  • Model Key Path ???
  • Value Transformer ???
  • or : Selector Name ???

My guess would go with "Selector Name", but Xcode doesn't give any autocompletion...

(I want to call the method selectNext)

Thank you !


Solution

  • You can not bind from Button to ArrayController.

    You can Drag from ArrayController to the button.

    Or,

    Select ArrayController -> connection's Inspector -> Recieved Actions -> Hook "selectNext:" to the button.