在设置未来日期时遇到一些问题。实际上我正试图这样做,
NSDate *date = [NSDate date] + MY_EXTRA_TIME;
答案 0 :(得分:12)
那应该是,
NSTimeInterval MY_EXTRA_TIME = 10; // 10 Seconds
NSDate *futureDate = [[NSDate date] dateByAddingTimeInterval:MY_EXTRA_TIME];
答案 1 :(得分:1)
<强>夫特强>
let delay:NSTimeInterval = 5
let fireDate = NSDate().dateByAddingTimeInterval(delay)