views:

488

answers:

1

how to handle button onclick action in iPhone without using interface builder?

+3  A: 

After you create a button write;

[myButton addTarget:self action:@selector(buttonAction) forControlEvents:UIControlEventTouchUpInside];

Edit

Also implement this in your .m file

-(void)buttonAction
{
    //your implementation
}
EEE
hi..i've aded addTarget functionality in my code. but stil on click of button , nothing is happening. no action is done.
suse
did you implement the action? See edit.
EEE