sleep 效果很好,但 runUntilDate 在后台线程上不起作用。但为什么?
-(IBAction) onDecsriptionThreadB:(id)sender
{
dispatch_async(dispatch_get_global_queue(0, 0), ^{
while (1)
{
NSLog(@"we are here");
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:2]];
//sleep(2);
}
});
}