我的代碼無法正常工作,因爲它無法識別「text」屬性。我正在使用ObjectiveC 我已經雙重檢查了所有內容,並且找不到錯誤。我是編程初學者,所以請原諒我的錯誤。 幫助非常需要! 我想爲我的應用程序創建一個計時器。Xcode:property「text」not found
int timeTick = 0;
- (void)viewDidLoad {
[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)startTimer:(id)sender {
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(tick) userInfo:nil repeats:YES];
}
-(void)tick{
timeTick++;
NSString *timeString = [[NSString alloc] initWithFormat:@"%d", timeTick];
labelTime.text = timeString;
}
@end
是什麼類型labelTime? – RobCroll 2014-12-03 02:09:21
你應該發佈確切的錯誤 – Andy 2014-12-03 02:18:54
這將有助於知道如何宣佈事情。 – 2014-12-03 02:34:20