views:

129

answers:

1

Hi guys,

I am just starting Objective-C for iPhone development and have hit a small problem.

I am trying to use a UIButton in order to open a new view.

So far I have got all the elements connected up in interface builder and have added a UIViewController subclass, I am just not sure what code I have to put in the method that my button is connected to in order to call the new view and open the .xib file.

Any advice would be great,

Thanks.

A: 

You need to use Target-Actions for this.

You can wire up an action method in your code to an event on a UIButton.

Most of the time, you will want to use touchUpInside for UIButtons.

Jacob Relkin
Thanks for your reply, I have connected this in Interface builder using touchUpInside to an action I have created but I am just not sure what the action requires in order for the view to open.
Alex
Are you using a `UINavigationController`?
Jacob Relkin