self.operationQueue = [[NSOperationQueue alloc] init];
[self.operationQueue addOperationWithBlock:^{
[self doSomethingElse];
}];
- (void)doSomethingElse {
[self doAnother];
}
Does this create a retain cycle? I keep a reference to the operation queue but not the operation. Thoughts?
This could create a retain cycle. Create a weak pointer to self and use that:
EDIT:
In your block, create a strong reference back to self. Evaluate your pointer to make sure it’s valid, and you’re safe. Your snippet (based on what you’ve described, then), should read: