我没有足够的声誉来发布图片..所以希望你能够帮助我解决这个问题。在第三行,其中写着“@implementation viewcontroller”,我的 xcode 告诉我“@end 在实现上下文中丢失”
提前致谢!
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
mainInt = 0;
randomMain = [NSTimer scheduledTimerWithTimeInterval:(1.0/1.0) target:self selector:@selector(randomMainvoid) userInfo:nil repeats:YES];
}
- (void)randomMainvoid {
mainInt +=1;
label.text = [NSString stringWithFormat:@"%d", mainInt];
}
- (IBAction)Start {
[startButton setHidden:YES];
timer = [NSTimer scheduledTimerWithTimeInterval:(0.0088) target:self selector:@selector(onTimer) userInfo:nil repeats:YES];
pos = CGPointMake(5.0, 6.0);
}
在......的最后@implementation ViewController
你需要@end
你的 .m 应该是这样的:
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
mainInt = 0;
randomMain = [NSTimer scheduledTimerWithTimeInterval:(1.0/1.0) target:self selector:@selector(randomMainvoid) userInfo:nil repeats:YES];
}
- (void)randomMainvoid {
mainInt +=1;
label.text = [NSString stringWithFormat:@"%d", mainInt];
}
- (IBAction)Start {
[startButton setHidden:YES];
timer = [NSTimer scheduledTimerWithTimeInterval:(0.0088) target:self selector:@selector(onTimer) userInfo:nil repeats:YES];
pos = CGPointMake(5.0, 6.0);
}
@end
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)