Skip to content

Instantly share code, notes, and snippets.

@khanlou
Created July 26, 2013 19:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khanlou/6091415 to your computer and use it in GitHub Desktop.
Save khanlou/6091415 to your computer and use it in GitHub Desktop.
Blocks are created on the stack frame that they are on
void (^block)();
if (condition) {
block = ^{
NSLog(@"some code");
};
} else {
block = ^{
NSLog(@"other code");
};
}
block();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment