Created
November 21, 2012 05:09
-
-
Save kenji4569/4123139 to your computer and use it in GitHub Desktop.
simple block-based task queue
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
NSMutableArray *tasks = [[NSMutableArray alloc] init]; | |
[tasks addObject: ^() { | |
NSLog(@"task1"); | |
}]; | |
[tasks addObject: ^() { | |
NSLog(@"task2"); | |
}]; | |
for (void (^task)() in tasks) { | |
task(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment