Pergunta

Estou recebendo um aviso ao criar o NSindexpath,

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

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

Qual é o aviso devido a ?? Como fazer dar certo?

Obrigado

Foi útil?

Solução

Você precisa ter a matriz ser do tipo NSUInteger (não assinado).

Está lhe dizendo que, porque o NSIndexPath não deseja valores negativos, que você pode potencialmente passar por meio de uma matriz nsinteger (realmente um INT).

Outras dicas

Supondo UITableViews. Você deve construir seu exemplo como assim: NSIndexPath *myIndexPath = [NSIndexPath indexPathForRow:0 inSection:3]; Ver Esta documentação da Apple Para maiores informações.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top