- Open story board.
- Drag a button (Round Rect Button) on the screen, the default text would be "Button". Let it be.
- Open ViewController.h and add the following code in the @interface section:-(IBAction)btnClicked:(UIButton *)sender;
- Open ViewController.m and add the following code in the @implementation section:-(IBAction) btnClicked:(UIButton *)sender{//Write your event handler code here}
- Open story board.
- Right click-drag from the button to the yellow View Controller icon.
- A popup will appear with some choices, at the end you will find btnClicked, select it.
- Done
Sunday, March 17, 2013
How to create a button click event handler
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment