I can't figure how to fix this Expected identifier or '('

后端 未结 2 771
花落未央
花落未央 2021-01-29 11:43
- (IBAction)SignUp:(id)sender;  {                                   Expected identifier or \'(\'

    IBOutlet UITextField *Firstnamefield;
    IBOutlet UITextField *Las         


        
2条回答
  •  太阳男子
    2021-01-29 12:39

    - (IBAction)SignUp:(id)sender {
       UITextField *Firstnamefield;
       UITextField *Lastnamefield;
       UITextField *emailfield;
       UITextField *agefield;
       UITextField *passwordfield;
       UITextField *reenterpasswordfield;
    }
    

    There a couple of problems. For one, you can not use the IBOutlet qualifier outside of an interface declaration. And passwordfield has a colon after it that should be a semicolon.

    In case this is the point of confusion, if you were creating the interface declaration for this IBAction, it would look like this:

    - (IBAction)SignUp:(id)sender;
    

    Other than that, the only other thing that could be causing this is if you are trying to place the entire IBAction inside the header file.

提交回复
热议问题