Created
July 26, 2013 19:06
-
-
Save khanlou/6091415 to your computer and use it in GitHub Desktop.
Blocks are created on the stack frame that they are on
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 (^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