Created
January 22, 2011 05:20
-
-
Save theleoborges/790884 to your computer and use it in GitHub Desktop.
learning-objective-c-a-ruby-analogy#3
This file contains 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 characters
//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