Created
February 3, 2013 08:05
-
-
Save bklimt/4700913 to your computer and use it in GitHub Desktop.
Objective-C Blocks Example C
This file contains 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]; | |
block(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment