Skip to content

Instantly share code, notes, and snippets.

@kenji4569
Created November 21, 2012 05:09
Show Gist options
  • Save kenji4569/4123139 to your computer and use it in GitHub Desktop.
Save kenji4569/4123139 to your computer and use it in GitHub Desktop.
simple block-based task queue
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