NSCondition waitUntilDate blocking main queue

I have a code working fine in iOS7 & 8 that wait with a timeout to load some data stored in a file



dispatch_async(dispatch_get_main_queue(), ^{

...

}

then

[self.abCondition lock];

NSDate *timeoutDate = [NSDate dateWithTimeIntervalSinceNow:timeout];

NSDate *startDate = [NSDate date];

BOOL signaled=NO;

while (!self.isUpAndRunning && (signaled = [self.abCondition waitUntilDate:timeoutDate])) {

NSLog(@"waiting to sync");

}


With iOS9, the block in dispatch_async is not called.

After the timeout, then I can see that the block is called.


How can I change this code ?

NSCondition waitUntilDate blocking main queue
 
 
Q