If no input sources or timers are attached to the run loop, this method exits immediately;
If you want to use runUntilDate you must add timer or input sources. My correct version is:
while (1)
{
NSLog(@"we are here");
[NSTimer scheduledTimerWithTimeInterval:100 target:self selector:@selector(doFireTimer:) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:2]];
//sleep(2);
}