我正在尝试使用按钮、计分器和计时器制作一个简单的应用程序,但我遇到了一些错误
#import <UIKit/UIKit.h>
@interface xyzViewController : UIViewController
{
IBOutlet UILabel *scoreLabel;
IBOutlet UILabel *timerLabel;
NSInteger count;
NSInteger seconds;
NSTimer *timer;
}
- (IBAction)buttonPressed //Expected ';' after method prototype
{
count++
scoreLabel.text = [NSString stringWithFormat:@"Score \n %i", count]
}
@end
如果我添加';' 我得到了这个:
- (IBAction)buttonPressed;
{ //Expected identifier or '('
count++
scoreLabel.text = [NSString stringWithFormat:@"Score \n %i", count]
}
@end
我必须做什么?