Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why NSIndexPath length always show 2?

I have created a NSIndexPath object but when I print the value of its length property it will always show the value as 2.

 NSIndexPath *index = [NSIndexPath indexPathForItem:0 inSection:4];

{length = 2, path = 4 - 0}

Why length is always 2?

like image 986
rishu1992 Avatar asked Apr 07 '16 04:04

rishu1992


2 Answers

Because the index path is made of two indexes - the section and the item number.

like image 103
rmaddy Avatar answered Oct 04 '22 17:10

rmaddy


basically NSIndexPath is combination of Section and Row, so it will show length as 2.

like image 41
Ronak Chaniyara Avatar answered Oct 04 '22 16:10

Ronak Chaniyara