I have created a button programmatically and I want to fire event to go next page, the event is not generated. What can I do?
This is the code:
btnSignUp =[UIButton buttonWithType:UIButtonTypeRoundedRect];
btnSignUp.frame =CGRectMake(20,250,280,35);
[btnSignUp setTitle:@"Sign Up" forState:UIControlStateNormal];
[btnSignUp addTarget:self action:@selector(registrationPage:)
forControlEvents:UIControlEventAllTouchEvents];
-(void)registrationPage:(id)sender
{
registration =[[RegistrationPage alloc] initWithNibName:@"Registration" bundle:[NSBundle mainBundle]];
[self.navigationController pushViewController:registration animated:YES];
}
You have done all grt work!! Just one line change..
btnSignUp =[UIButton buttonWithType:UIButtonTypeRoundedRect];
This will definitely work for you