Skip to content

Instantly share code, notes, and snippets.

@kastiglione
Forked from jspahrsummers/gist:6940184
Last active December 25, 2015 07:59
Show Gist options
  • Save kastiglione/6943213 to your computer and use it in GitHub Desktop.
Save kastiglione/6943213 to your computer and use it in GitHub Desktop.
void (^myBlock)(int);
__block __weak __typeof__(myBlock) myRecursiveBlock = myBlock = ^(int x) {
if (x > 5) {
return;
} else {
myRecursiveBlock(x + 1);
}
};
myBlock(1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment