Skip to content

Instantly share code, notes, and snippets.

@r-plus
Created February 11, 2014 12:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r-plus/8934385 to your computer and use it in GitHub Desktop.
Save r-plus/8934385 to your computer and use it in GitHub Desktop.
@implementation NSArray(ValueAtIndex)
- (NSArray *)valueAtIndex:(NSUInteger)index
{
NSMutableArray *array = [NSMutableArray array];
for (NSArray *a in self)
if (a.count >= index + 1)
[array addObject:a[index]];
return [NSArray arrayWithArray:array];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment