user605957
user605957

Reputation: 2489

How do I attach an action to a button using Interface Builder?

I am new to Interface Builder. I have a method (IBAction) defined in my class. I want to fire this method when a particular button is clicked.

I cant see any way to add an action via the IBBuilder

Upvotes: 1

Views: 213

Answers (2)

Regexident
Regexident

Reputation: 29552

Setting up an Action

  1. Right-Click on your control instance
  2. Drag to your target and let go.

Setting up an Action


Setting up an Outlet

  1. Right-Click on your object instance
  2. Drag to your control instance and let go.

Setting up an Outlet


Inspecting Actions/Outlets/Bindings

  1. Right-Click on your object instance

Inspecting Actions/Outlets/Bindings

Upvotes: 1

Paulo Correia
Paulo Correia

Reputation: 616

Have you defined your method as an IBAction? You need to do like this for the method appear in the "File Owner's".

Upvotes: 0

Related Questions