为什么 NSIndexPath 长度总是显示 2?
Why NSIndexPath length always show 2?
我已经创建了一个 NSIndexPath 对象,但是当我打印它的长度值时 属性 它总是将值显示为 2。
NSIndexPath *index = [NSIndexPath indexPathForItem:0 inSection:4];
{length = 2, path = 4 - 0}
为什么长度总是 2?
因为索引路径由两个索引组成 - 部分和项目编号。
基本上NSIndexPath
是Section和Row的组合,所以它会显示长度为2。
我已经创建了一个 NSIndexPath 对象,但是当我打印它的长度值时 属性 它总是将值显示为 2。
NSIndexPath *index = [NSIndexPath indexPathForItem:0 inSection:4];
{length = 2, path = 4 - 0}
为什么长度总是 2?
因为索引路径由两个索引组成 - 部分和项目编号。
基本上NSIndexPath
是Section和Row的组合,所以它会显示长度为2。