NSIndexPath warnings in Obj-C

I get a warning when creating NSIndexPath,

NSInteger arr[] = {0,3};
[NSIndexPath indexPathWithIndexes:arr length:2]

warning: pointer targets in passing argument 1 of 'indexPathWithIndexes:length:' differ in signedness

What is the warning due ?? How to make it work?

thank

+3
source share
2 answers

You need to have an array of type NSUInteger(unsigned).

This tells you that since NSIndexPath does NOT want negative values โ€‹โ€‹that you could potentially pass through an NSInteger array (really, int).

+5
source

, iPhone, UIKit, UITableViews. : NSIndexPath *myIndexPath = [NSIndexPath indexPathForRow:0 inSection:3]; . Apple.

+5

Source: https://habr.com/ru/post/1728002/


All Articles