While learning about NSOperation, I wondered why a completion block would have any advantage over a callback to a method within my subclassed NSOperation. I understand how blocks can be used to organize my code in a more tightly coupled fashion and I have used them this way myself (as opposed to using delegate methods that handle callbacks from multiple objects).
In the case of NSOperation, the entire operation is self-contained within the class and my subclass. It encompasses a single operation, and all of the methods are focused on that single operation. So, in this case, I’m not seeing what a completion block has to offer. What am I missing in my understanding?
The main point is probably that the Block can capture variables local to its creating scope. With a callback function, you might have to explicitly pass around a context structure or object. The completion Block can do this in a smoother, more “automatic”, manner.