Unrecognized Selector Sent to Instance [NSCFString subarrayWithRange:]
I have the following code which is producing this error. I cannot understand why the subarrayWithRange message is being sent to a string? When it is clearly an array? 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]); } Error: -[NSCFString subarrayWithRange:]: