【发布时间】:2013-09-13 19:13:46
【问题描述】:
我想存储 NSDate 中经过的时间量。所以当一个按钮被触发时,我想要一个计时器开始计数,我猜以秒为单位,然后存储用户在 NSDate 中点击下一个按钮之前已经过去了多少时间,这样我就可以从另一个 NSDate 中减去这个值以获得差异使用 NSTimeInterval。
NSDate *date = [[NSDate alloc] initWithTimeIntervalSinceNow:(slider.value * 60)];
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:[date timeIntervalSinceNow] target:self selector:@selector(nextFunction) userInfo:nil repeats:NO];
【问题讨论】:
标签: ios nsdate nstimer nstimeinterval