Skip to content

Instantly share code, notes, and snippets.

@TonnyXu
Created August 8, 2011 15:01
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 TonnyXu/1131908 to your computer and use it in GitHub Desktop.
Save TonnyXu/1131908 to your computer and use it in GitHub Desktop.
NSIndexPath is uniqued and shared.
#define myIndexPath [NSIndexPath indexPathForRow:2 inSection:1]
NSAssert(myIndexPath == [NSIndexPath indexPathForRow:2 inSection:1], @"they should be the same object");
// omitted code from UITableView -cellForRowAtIndexPath:
if (myIndexPath == systemIndexPath){
// my cell, show my contents
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment