Created
September 24, 2012 21:03
-
-
Save jparise/3778366 to your computer and use it in GitHub Desktop.
-arrayByApplyingBlock:
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
- (NSArray *)arrayByApplyingBlock:(id (^)(id obj))block { | |
NSParameterAssert(block != nil); | |
NSMutableArray *result = [NSMutableArray arrayWithCapacity:self.count]; | |
for (id obj in self) { | |
[result addObject:block(obj)]; | |
} | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment