Serializing asynchronous tasks in objective C
问题 I wanted to be able to serialize 'genuinely' async methods, for example: making a web request showing a UIAlertView This is typically a tricky business and most samples of serial queues show a 'sleep' in an NSBlockOperation's block. This doesn't work, because the operation is only complete when the callback happens. I've had a go at implementing this by subclassing NSOperation, here's the most interesting bits of the implementation: + (MYOperation *)operationWithBlock:(CompleteBlock)block {