mc47mc mc47mc - 1 year ago 74
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 = (

Dutch = (

Portuguese = (

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 Source

just use

NSArray*languages = [result allKeys];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download