Skip to content

Instantly share code, notes, and snippets.

@allending
Created September 18, 2011 08:03
Show Gist options
  • Save allending/1224866 to your computer and use it in GitHub Desktop.
Save allending/1224866 to your computer and use it in GitHub Desktop.
- (void)testBlock {
NSMutableArray *array = [[NSMutableArray alloc] initWithObjects:@"foo", @"bar", nil];
void(^block)(void) = ^{
// probably dies in here
[array addObject:@"bomb"];
[array removeObject:@"bomb"];
};
// block retains array?
[array release];
block();
// block still in scope
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment