I’m start to use GCD, and I need to know when a certain thread has ended it’s job.
My code:
dispatch_queue_t registerDeviceQueue = dispatch_queue_create("RegisterDevice", NULL);
dispatch_async(registerDeviceQueue, ^{
[self registerDevice];
dispatch_async(dispatch_get_main_queue(), ^{
[aiRegisterDevice stopAnimating];
});
});
dispatch_release(registerDeviceQueue);
I need to know when this tread has ended, so that the UIActivityView can stop.
The way it is now, it’s stops before the thread ends.
Thanks,
RL
I’d set up a group and use
dispatch_group_waitto continue only when the computation has finished. To take your example:Or, if you want to prevent the callback blocking use
dispatch_group_notify: