我无法弄清楚如何修复此预期标识符或'(' [英] I can't figure how to fix this Expected identifier or '('

查看:110
本文介绍了我无法弄清楚如何修复此预期标识符或'('的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

- (IBAction)SignUp:(id)sender;  {                                   Expected identifier or '('

    IBOutlet UITextField *Firstnamefield;
    IBOutlet UITextField *Lastnamefield;
    IBOutlet UITextField *emailfield;
    IBOutlet UITextField *agefield;
    IBOutlet UITextField *passwordfield:
    IBOutlet UITextField *reenterpasswordfield;
}


推荐答案

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

有一些问题。例如,你不能在接口声明之外使用IBOutlet限定符。 passwordfield 有一个在它之后应该是分号的冒号。

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.

如果这是混乱的点,如果你创建了这个IBAction的terface声明,它看起来像这样:

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;

除此之外,唯一可能造成这种情况的是,如果你试图放置整个IBAction在头文件中。

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.

这篇关于我无法弄清楚如何修复此预期标识符或'('的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆