NSIndexPath method getIndexes .... how?

Do not confuse using this method and the documentation that lists it as a method (void).

"when returning indexes of the path pointer"

where is he returning something too?

If this is not the case:

- (NSIndexPath *)getIndexes:(NSUInteger *)indexes

getIndexes: Provides a reference to pointer indices.

- (void)getIndexes:(NSUInteger *)indexes

Parameters indices Pointer to an unsigned integer array. When returning, indexes indicate indexes. Availability Available in iOS 2.0 and later. Announced in NSIndexPath.h

+3
source share
4 answers

You must allocate an NSUInteger array of size [lengthPath length] and pass it as an argument. The return value will be written here. You must release this array yourself or do nothing to create it on the stack:

NSUInteger array[[indexPath length]];
[indexPath getIndexes: array];
+4

,

C .

C, , - .

NSUInteger indexCount = [indices count];
NSUInteger buffer[indexCount];
[indices getIndexes:buffer maxCount:indexCount inIndexRange:nil];
+2

NSIndexPath, . -getIndexes: . , - :

NSUInteger *indexes = calloc([indexPath length], sizeof(NSUInteger));
[indexPath getIndexes:indexes];

, indexPath.

0

Max, Thomas and Caleb, I tried all three methods and I can’t get anything to work, so I may have fired the decision too quickly ..... but most likely I just don’t get it? I cannot get the correct size of the array to skip, to access the required rows in my table. I would like, although calloc ([indexPath length], sizeof (NSUInteger)) for a group with 5 rows will return an array with 5 rows with every row containing NSUintegr ..... or I still don’t embarrass her

0
source

All Articles