How to create the “indexes” required for NSIndexPath:indexPathWithIndexes:length:

前端 未结 4 738
鱼传尺愫
鱼传尺愫 2020-12-23 16:45

The class method to create an index path with one or more nodes is:

+ (id)indexPathWithIndexes:(NSUInteger *)indexes length:(NSUInteger)length
4条回答
  •  攒了一身酷
    2020-12-23 17:16

    You assumption is correct. It's as simple as a C array of NSUInteger. The length parameter is the number of elements in the indexes array.

    Arrays in C are often identified as a pointer (in this case NSUInteger *) with a length parameter or a known terminator such as \0 for C strings (which is just a char array).

提交回复
热议问题