I'm using blocks inside a NSOperation. The main method of my NSOperation looks like this:
- (void) main {
[self callMethodOfALiraryUsingCompletionBlock:^() {
//this method takes time to execute, will call this block when done
}];
}
I'd like my NSOperationto terminate when what's inside the block is done. Currently, it returns directly, before what's inside the block is executed ... Any idea how I can solve this ?
Little detail in your question, here is one possible outline which may help:
dispatch_semaphore_create)dispatch_async)HTH