Skip to content

Instantly share code, notes, and snippets.

@theleoborges
Created January 22, 2011 05:20
Show Gist options
  • Save theleoborges/790884 to your computer and use it in GitHub Desktop.
Save theleoborges/790884 to your computer and use it in GitHub Desktop.
learning-objective-c-a-ruby-analogy#3
//in the interface file
@interface NSArray (each)
-(void) each: (void (^)(id *))block;
@end
//in the implementation file
@implementation NSArray (each)
-(void) each: (void (^)(id *))block {
for (id *object in self) {
block(object);
}
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment