Seletor não reconhecido enviado para a instância [NSCFString subarrayWithRange:]
Eu tenho o seguinte código que está produzindo esse erro. Não consigo entender por que a mensagem subarrayWithRange está sendo enviada para uma string? Quando é claramente uma matriz?
static const int kItemsPerView = 20;
NSRange rangeForView = NSMakeRange( page * kItemsPerView, kItemsPerView );
NSMutableArray *temp = [[APP_DELEGATE keysArray] mutableCopyWithZone:NULL];
NSArray *itemsForView = [temp subarrayWithRange:rangeForView];
for (int loopCounter = 0;loopCounter < r*c;loopCounter++){
NSLog(@"%i: %@ ", loopCounter, [itemsForView objectAtIndex:loopCounter]);
}
Erro:
-[NSCFString subarrayWithRange:]: unrecognized selector sent to instance 0x6b071a0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: [NSCFString subarrayWithRange:]:
obrigado