Skip to content

Instantly share code, notes, and snippets.

@k06a
Created March 29, 2014 11:06
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 k06a/9852508 to your computer and use it in GitHub Desktop.
Save k06a/9852508 to your computer and use it in GitHub Desktop.
@interface NSIndexPath (SharedIndexPath)
@end
@implementation NSIndexPath (SharedIndexPath)
+ (instancetype)sharedIndexPathForRow:(NSInteger)row inSection:(NSInteger)section
{
static NSIndexPath *arr[10][10] = {nil};
if (arr[row][section] == nil)
arr[row][section] = [NSIndexPath indexPathForRow:row inSection:section];
return arr[row][section];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment