I have a data situation where I want to use an index path. When I view the data, I want to increase the last node NSIndexPath. The code I have so far is:
int nbrIndex = [indexPath length]; NSUInteger *indexArray = (NSUInteger *)calloc(sizeof(NSUInteger),nbrIndex); [indexPath getIndexes:indexArray]; indexArray[nbrIndex - 1]++; [indexPath release]; indexPath = [[NSIndexPath alloc] initWithIndexes:indexArray length:nbrIndex]; free(indexArray);
This is a bit like, uncomfortable. Is there a better way to do this?
source share