Button Not working iOS

前端 未结 2 1203
执念已碎
执念已碎 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

    The method appears fine to me. Double check that:

    1. You've set in IB the class of your view controller that contains the button to the correct class.

    2. When you right-click on the button in IB it has the IBAction hooked up.

提交回复
热议问题