Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //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
Add Comment
Please, Sign In to add comment