I have the following line:
[self.keys addObjectsFromArray:[newArray objectAtIndex:0]];
newArray is an array of arrays.
I want NSMutableArray keys to be the array at the first index of newArray.
what this is returning is zero when I should be getting two.
This is how newArray is built, and appears to look right when i debug it.
NSPredicate *filterPredicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", sSelectedCat];
NSArray *newArray = [[aDictionary allKeys] filteredArrayUsingPredicate: filterPredicate];
When I debug the code and hover over [newArray objectAtIndex:0] it is showing it as an NSCFString where I was hoping that it would be an NSArray.
What am I not seeing here?
newArrayis just a normal array of strings.filteredArrayUsingPredicate:returns a single array. I think you probably want:This will make
keysan NSMutableArray containing your filtered keys.