我可能会误解该函数的作用runMode:beforeDate:
,但为什么它似乎永远运行(至少超过 10 秒设置)。
NSRunLoop *theRL = [NSRunLoop currentRunLoop];
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:10];
while ([theRL runMode:NSDefaultRunLoopMode beforeDate:date]) {
NSLog(@"in loop %d %@ %@", [theRL runMode:NSDefaultRunLoopMode beforeDate:date], date, [NSDate date]);
}