I am having an issue with a simple for loop setup in my app. Upon reaching the second for loop, my app crashes and I get the error below:
for (NSArray *a in dict)
{
for (NSString *s in a)
{
}
}
Error:
-[__NSCFString countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x1c5b6810
This seems slightly strange. I just want to look at each array in my dictionary, then as I get to them in the loop, check the strings in those arrays.
You probably want something like this:
since based on your error message, your keys appear to be strings (
__NSCFString). The behaviour offor (NSArray *s in dict)is to enumerate the keys of the dictionary.