How to work with NSOperationQueue and NSBlockOperation with dispatch gcd?
问题 Here is the code @interface ViewController () @property (nonatomic, strong) NSOperationQueue *queue; @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; _queue = [[NSOperationQueue alloc] init]; NSBlockOperation *aBlockOperation = [[NSBlockOperation alloc] init]; __weak NSBlockOperation* aWeakBlockOperation = aBlockOperation; [aBlockOperation addExecutionBlock:^{ NSLog(@"queue should still have the operation. And it does. yay!: %@", [_queue operations]); // This