I am using AFNetworking for parsing JSON output and am at a point where I am returning search results in the form of JSON. I am not sure if I should save the results as NSDictionary or NSArray? I want to show the data in a table view controller and the result set could be anywhere from 50-100 or more.
Any tips?
Here is my code:
if (success) {
NSDictionary *searchResults = [responseObject valueForKeyPath:@"searchResults"];
NSLog(@"%@",searchResults);
}
You should store it in whichever format it is returned. Most likely it’ll be an NSArray (or an NSDictionary with exactly one entry being an NSArray – in this case you’ll also want to save it as an array).