NSIndexpath.item vs NSIndexpath.row

Okay, nobody has given a good answer here.

Inside NSIndexPath, the indexes are stored in a simple c array called “_indexes” defined as NSUInteger* and the length of the array is stored in “_length” defined as NSUInteger. The accessor “section” is an alias to “_indexes[0]” and both “item” and “row” are aliases to “_indexes[1]”. Thus the two are functionally identical.

In terms of programming style – and perhaps the definition chain – you would be better using “row” in the context of tables, and “item” in the context of collections.

Leave a Comment