0
我這裏有這些功能,將記錄的起點,然後按一個按鈕來停止時間之間的時間,最後打印的時間記錄長度:使用不同文件中的值更改標籤文本?
-(void)informToPress
{
textLabel.text = @"Test, press the button";
//begin record and end record on button press
startDate = [[NSDate alloc]init];
}
-(IBAction)stopTime{
stopDate = [[NSDate alloc]init];
textLabel.text = [NSString stringWithFormat:@"Time : %f", [stopTimer timeIntervalSinceDate:startTimer]];
}
但在那裏我有:
textLabel.text = [NSString stringWithFormat:@"Time : %f", [stopTimer timeIntervalSinceDate:startTimer]];
我需要將它放在不同的視圖中,因此需要一個不同的.m文件!我怎麼能在一個完全不同的文件中使用這行代碼?由於新文件/視圖不知道這些值是什麼或textLabel。