我是一名学生,正在学习和为我的学校开发一款应用程序,我刚刚开始并且做得很好,但是我收到错误“Expected identifier or' “我已经花了几天的时间阅读帖子和谷歌,并没有解决方案,我发现正在为我工作预期的标识符或'(' - xCode
我想在我的应用程序的第二个选项卡上的圆形按钮链接到学校。网站
这里是.H:
#import <UIKit/UIKit.h>
@interface SecondViewController : UIViewController {
}
- (IBAction)Website:(id)sender;
@end
这里是我的.m错误COM mented:
#import "SecondViewController.h"
@interface SecondViewController()
@end
@implementation SecondViewController
-(IBAction)Website {
[[UIApplication sharedApplication ] openURL:[NSURL URLWithString:@"http://www.google.com"]];
}
{ **// Error is on this line[23]**
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)Website;
- (IBAction)Website:(id)sender; {
}
@end
我该如何解决这个小家伙?非常感谢你! 此外,.h文件由xCode组成,通过简单地控制从按钮拖动到.h并创建一个动作。这可能是原因吗?
你没有viewDidload方法! –