NSIndexPath indexPathWithIndexes
+ (id)indexPathWithIndexes:(NSUInteger *)indexes length:(NSUInteger)length
Parameters
indexes
Array of indexes to make up the index path.
length
Number of nodes to include in the index path.
Return Value of [NSIndexPath indexPathWithIndexes]
Index path with indexes up to length.
NSIndexPath indexPathWithIndexes example.
You might use it like this:
NSUInteger indexArr[] = {1,2,3,4};
NSIndexPath *indexPath = [NSIndexPath indexPathWithIndexes:indexArr length:4];
NSUInteger indexArr[] = {1,2,3,4};
NSIndexPath *indexPath = [NSIndexPath indexPathWithIndexes:indexArr length:4];
Example of [NSIndexPath indexPathWithIndexes].
This is probably the best you can do:
NSUInteger u_array[] = {0, 0, 0};
NSIndexPath *index_path = [NSIndexPath indexPathWithIndexes:u_array length:3];
NSUInteger u_array[] = {0, 0, 0};
NSIndexPath *index_path = [NSIndexPath indexPathWithIndexes:u_array length:3];
NSIndexPath indexPathWithIndexes example.
NSIndexPath *someIndexPath = [NSIndexPath indexPathWithIndexes:newIndexes
length:len];
NSUInteger newIndexes2[[someIndexPath length]];
[someIndexPath getIndexes:newIndexes2];
NSUInteger len2 = sizeof(newIndexes2)/sizeof(NSUInteger);
NSIndexPath *baseIndexPath2 = [NSIndexPath indexPathWithIndexes:newIndexes2
length:len2];
NSUInteger ii;
NSInteger start = [someIndexPath indexAtPosition:[someIndexPath length] -1];
for (ii=start; ii<10; ii++) {
NSIndexPath *newIndexPath2 = [baseIndexPath2 indexPathByAddingIndex:ii];
NSLog(@"newIndexPath2 = %@", newIndexPath2);
}
length:len];
NSUInteger newIndexes2[[someIndexPath length]];
[someIndexPath getIndexes:newIndexes2];
NSUInteger len2 = sizeof(newIndexes2)/sizeof(NSUInteger);
NSIndexPath *baseIndexPath2 = [NSIndexPath indexPathWithIndexes:newIndexes2
length:len2];
NSUInteger ii;
NSInteger start = [someIndexPath indexAtPosition:[someIndexPath length] -1];
for (ii=start; ii<10; ii++) {
NSIndexPath *newIndexPath2 = [baseIndexPath2 indexPathByAddingIndex:ii];
NSLog(@"newIndexPath2 = %@", newIndexPath2);
}