Before ARC I had the following code that retains the delegate while an async operation is in progress:
- (void)startAsyncWork { [_delegate retain]; // ca
Something like this:
- (void)startAsyncWork { id delegate = _delegate; dispatch_async(/* some queue */, ^{ // do work [delegate doSomething]; } }
The block will retain the delegate as long as needed...