如何创建“索引” NSIndexPath所需:indexPathWithIndexes:length: [英] How to create the "indexes" required for NSIndexPath:indexPathWithIndexes:length:
本文介绍了如何创建“索引” NSIndexPath所需:indexPathWithIndexes:length:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
用一个或多个节点创建索引路径的类方法是:
The class method to create an index path with one or more nodes is:
+ (id)indexPathWithIndexes:(NSUInteger *)indexes length:(NSUInteger)length
如何创建第一个参数?
How do we create the "indexes" required in the first parameter?
文档将其列为组成索引路径的索引数组,但它期望有一个(NSUinteger *)。
The documentation listed it as Array of indexes to make up the index path but it is expecting a (NSUinteger *).
要创建一个1.2.3.4的索引路径,它只是一个[1,2,3,4]的数组?
To create an index path of 1.2.3.4, is it simply an array of [1,2,3,4] ?
推荐答案
您是正确的。您可以这样使用它:
You are correct. You might use it like this:
NSUInteger indexArr[] = {1,2,3,4};
NSIndexPath *indexPath = [NSIndexPath indexPathWithIndexes:indexArr length:4];
这篇关于如何创建“索引” NSIndexPath所需:indexPathWithIndexes:length:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文