mc47mc mc47mc - 1 month ago 10
iOS Question

NSArray unrecognized selector sent to instance on Json

I am new to Objective-C And here I have a Json that I've stored into a NSArray. And I am trying to get the English, Dutch, Portuguese

{
English = (
One,
Two,
Three

);
Dutch = (
Een
);

Portuguese = (
Um,
Dois
}


And here's what I've done:

languageArray = result;

for (i = [languageArray count] - 1; i >= 0; i--)
{
NSString *languageTitle = [languageArray objectAtIndex:i];
NSLog(@"languageTitle %@", languageTitle);
}


And I have this error -[__NSCFDictionary objectAtIndex:]: unrecognized selector sent to instance 0x7f8c68e53610 but my languageArray count is 3. I don't know why I can't get the objectAtIndex:i I've tried to use objectAtIndex:0 but still the same result

Answer

just use

NSArray*languages = [result allKeys];
Comments