This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| typedef void (^eBlock)(); | |
| eBlock exampleE_getBlock() { | |
| char e = 'E'; | |
| void (^block)() = ^{ | |
| printf("%c\n", e); | |
| }; | |
| return block; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| typedef void (^dBlock)(); | |
| dBlock exampleD_getBlock() { | |
| char d = 'D'; | |
| return ^{ | |
| printf("%c\n", d); | |
| }; | |
| } | |
| void exampleD() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void exampleC_addBlockToArray(NSMutableArray *array) { | |
| [array addObject:^{ | |
| printf("C\n"); | |
| }]; | |
| } | |
| void exampleC() { | |
| NSMutableArray *array = [NSMutableArray array]; | |
| exampleC_addBlockToArray(array); | |
| void (^block)() = [array objectAtIndex:0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void exampleB_addBlockToArray(NSMutableArray *array) { | |
| char b = 'B'; | |
| [array addObject:^{ | |
| printf("%c\n", b); | |
| }]; | |
| } | |
| void exampleB() { | |
| NSMutableArray *array = [NSMutableArray array]; | |
| exampleB_addBlockToArray(array); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void exampleA() { | |
| char a = 'A'; | |
| ^{ | |
| printf("%c\n", a); | |
| }(); | |
| } |
NewerOlder