========================NSIndexPath========================
--简介:The NSIndexPath class represents the path to a specific node in a tree of nested array collections. This path is known as an index path。NSIndexPath类代表着“嵌套数组的树”中得某节点的路径。如下图:
NSIndexPath 让你精确指定一个树结构 data structure 里面的某个节点的数据。比如你有一个 NSArray, 里面很多节点,每个节点又是一个 NSArray,每个节点的这个里面又是一个NSArray,然后下面又是一个 NSArray,这样简单说起来,你有一个四层的 NSarray ,每层下面都有好多个 NSArray。然后你造一个NSIndexPath 1.3.4.2。你就可以拿它访问,第一层的第三个节点之下的第四个节点的第二个节点的数据。
------------常用方法和属性------------
--用Index 或者 index数组和路径的长度 创建NSIndexPath;
+ (instancetype)indexPathWithIndex:(NSUInteger)index;
+ (instancetype)indexPathWithIndexes:(const NSUInteger [])indexes length:(NSUInteger)length;
- (instancetype)init; /* designated initializer