Skip to content

Instantly share code, notes, and snippets.

@plantpurecode
Created July 19, 2012 18:36
Show Gist options
  • Save plantpurecode/3145880 to your computer and use it in GitHub Desktop.
Save plantpurecode/3145880 to your computer and use it in GitHub Desktop.
@interface NSArray(JRAdditions)
- (id)jr_objectAtIndex:(long long)index {
NSUInteger realIndex = index;
if(index < 0) {
realIndex = [self count] - (+index);
}
return [self objectAtIndex:realIndex];
}
@end
@asmallteapot
Copy link

Wrap-around indexes? Neat!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment