Skip to content

Instantly share code, notes, and snippets.

@bjhomer
Last active August 29, 2015 14:03
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 bjhomer/bdd2f09ed0b82820058f to your computer and use it in GitHub Desktop.
Save bjhomer/bdd2f09ed0b82820058f to your computer and use it in GitHub Desktop.
// Does this code create 10000 live instances of MyObj before returning?
// Or will each one be released on the following iteration?
void foo() {
NSLog(@"Starting!");
int i=0;
start:
id obj = [MyObj new];
if (++i<10000) {
goto start;
}
NSLog(@"done with obj: %@", obj);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment