self.myArray = @[ [^{ NSLog(@"a"); } copy],
[^{ NSLog(@"b"); } copy]];
然後
[self.myArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
// This syntax is wrong, but I hope you get my intention
void (^) (void) block = obj;
block();
}];
假如可以不用typedef,在枚舉的時候怎麼剔除block?
應該改成
void (^block )(void) = obj;
關於block定義可以看這個例子
void (^blockReturningVoidWithVoidArgument)(void);
int (^blockReturningIntWithIntAndCharArguments)(int, char);
void (^arrayOfTenBlocksReturningVoidWithIntArgument[10])(int);