Button Not working iOS

前端 未结 2 1223
执念已碎
执念已碎 2021-01-23 19:35

I inserted a button in IB, added this code in the .h file

-(IBAction)buttonPressed:(id)sender;

Connected the action to the button in IB (Touch

2条回答
  •  渐次进展
    2021-01-23 20:13

    You aren't showing the rest of your code - it should look something like

    YourViewController *yourViewController = [[YourViewController alloc] initWithNibName:@"YourViewController" bundle:nil];
    yourViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
    [self presentModalViewController:yourViewController animated:YES];
    

    make sure that you have included YourViewController.h in the .m of the calling View Controller .

提交回复
热议问题