在下面粘贴的代码中,如何检查/确保在执行对“showResultToUser”的调用时对象仍然存在并且我不会调用已发布的对象?
__block MyClass pSelf = self;
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_async(queue, ^
{
[pSelf doSomeBackgroundWork];
dispatch_async(dispatch_get_main_queue(), ^
{
[pSelf showResultToUser];
});
});