I am reading the https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/WorkingwithBlocks/WorkingwithBlocks.html working with blocks, and see following code:
void (^(^complexBlock)(void (^)(void)))(void) = ^ (void (^aBlock)(void)) {
...
return ^{
...
};
};
The above complexBlock variable refers to a block that takes another block as an argument (aBlock) and returns yet another block.
My question is that can I rewrite it as:
void (^) (void) (^complexBlock)(void (^)(void)) = ^ (void (^aBlock)(void)) {
...
return ^{
...
};
};
This makes it easier to understand right? I understand rewriting the code to use a type definition makes this much more readable, but my question is if don't use that, can I rewrite it this way? Many thank.