How to avoid nested blocks
问题 GCD and blocks are so nice and convenient. But when I fall in love with it, I found that something bad happened. Look at these codes below: [self functionA:^(BOOL success) { if (success) { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) { [self functionB:^(NSError *error) { if (error != nil) { dispatch_async(dispatch_get_main_queue(), ^(void) { [self functionC:^(id result) { if (result) { [self functionD:^(BOOL success) { if (success) { [self DoSomething]