I would like to know the easiest way to wait for code to finish execution within an objective c project because I am calling a webservice and retrieving the results and inst
You do it easily as below,
-(void)aFunc {
Do Asynchronous A job...
while (A is not finished) {
// If A job is finished, a flag should be set. and the flag can be a exit condition of this while loop
// This executes another run loop.
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
}
Do things using the A's result.
}