I might be misunderstanding what the function runMode:beforeDate:
does but why does this seem to run forever (at least beyond the 10 seconds set).
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]);
}