Objective c 在目标C中显示游戏开始后经过的时间

Objective c 在目标C中显示游戏开始后经过的时间,objective-c,Objective C,我的目标是显示游戏开始后经过的时间(应该不断更新) 我知道如何找到从比赛开始到比赛结束的时间。但是我不知道如何用秒表在屏幕上持续更新。用秒表启动计时器 self.updateTimer=[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(无论您调用了什么方法来更新显示以显示当前时间)userInfo:nil repeats:YES] 将每隔一秒更新您的显示True。您可以使用UILabel来显示时间。只

我的目标是显示游戏开始后经过的时间(应该不断更新)

我知道如何找到从比赛开始到比赛结束的时间。但是我不知道如何用秒表在屏幕上持续更新。

用秒表启动计时器

self.updateTimer=[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(无论您调用了什么方法来更新显示以显示当前时间)userInfo:nil repeats:YES]


将每隔一秒更新您的显示

True。您可以使用UILabel来显示时间。只需将标签文本更改为新时间并调用setNeedsDisplay。在@selector(updateMedisPlay:)中执行此操作。。。