Objective-C: Instance Variable in Category

A category can not declare additional instance variables but since OS X 10.6 and iOS 3.1 you can work around this with associative references. You can use associative references to simulate the addition of object instance variables to an existing class. Using associative references, you can add storage to an object without modifying the class … Read more

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 … Read more