Last active
October 6, 2015 20:38
Revisions
-
itod renamed this gist
Feb 13, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
itod revised this gist
Jul 5, 2012 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ // compiled with ARC enabled NSArray *foo() { NSMutableArray *res = [NSMutableArray array]; for (int i = 0; i < 3; i++) { -
itod created this gist
Jul 5, 2012 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ NSArray *foo() { NSMutableArray *res = [NSMutableArray array]; for (int i = 0; i < 3; i++) { [res addObject:^{ NSLog(@"%d", i); }]; } return res; } int main(int argc, const char * argv[]) { @autoreleasepool { NSArray *funcs = foo(); for (void (^func)(void) in funcs) { func(); } } } // prints: // 0 // 1 // 2