CREATING INDEX FOR NSINDEXPATH CLASS METHOD INDEXPATHWITHINDEXES:LENGTH:

zack mathews

Total Post:23

Points:161
Posted by  zack mathews
 1189  View(s)
Ratings:
Rate this:
The method of NSIndexPath class is:
+(id)indexPathWithIndexes:(NSUInteger *)indexes length:(NSUInteger)length
My problem is with indexes, I am unable to create indexes for the first parameter?
In the documentation I was read it is as Array of indexes to make up the index path, but expecting a (NSUinteger*), to create index path of 1.2.3.4 , is it simply an array of[ 1, 2, 3, 4 ] ?
  1. Tarun Kumar

    Post:214

    Points:1642
    Re: Creating index for NSIndexPath class method indexPathWithIndexes:length:

    Your imagination is correct, it is like an array of NSUInteger, and the second parameter length is no of elements in the indexes array.
    So you can use it like that:

    NSUInteger arrayOfIndexes[] = { 1, 2, 3, 4 };
    NSIndexPath *indexPath = [NSIndexPath indexPathWithIndexes:arrayOfIndexes

    length: 4];

      Modified On Nov-05-2015 10:21:41 PM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!