我有一个类似的方法:
- (void)loadStoreWithCompletion:(CompletionBlock)loadCompletion
{
dispatch_queue_t loadQueue = dispatch_queue_create("loadQueue", DISPATCH_QUEUE_SERIAL);
dispatch_async(loadQueue, ^{
// ... Do background stuff ...
});
dispatch_async(loadQueue, ^{
dispatch_async(dispatch_get_main_queue(), ^{
loadCompletion();
});
});
dispatch_release(loadQueue);
}
我是否需要复制该loadCompletion
块,因为它只有在此方法的调用者不再存在时才可能被调用,还是这样可以?