I see this as a very common problem for people trying to parse, but I'm still at a loss for what I need to do:
I have a json, I'm reading it from php webservice response:
{
Name: "Balrog",
Origin: "USA",
Age: "28",
Height: "6`5",
Weight: "252 lbs",
Game: "Street Fighter",
Image: "N/A"
},
{
Name: "Faust",
Origin: "Parts Unknown",
Age: "Unknown",
Height: "9`1",
Weight: "165 lbs",
Game: "Guilty Gear",
Image: "N/A"
},
{
Name: "Hugo",
Origin: "Germany",
Age: "28",
Height: "8`2",
Weight: "440 lbs",
Game: "Final Fight",
Image: "N/A"
}
But when I try to parse I face many problems around declaring the "NSDictionary" area. I know the *results' "objectforkey" needs to be changed, but I have no idea.
listOfFighters = nil;
NSString* WebServiceURL = @"URL_GOES_HERE";
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_async(queue, ^{
// Get the JSON string from our web serivce
NSDictionary * dictionary = [JSONHelper loadJSONDataFromURL:WebServiceURL];
dispatch_async(dispatch_get_main_queue(), ^{
// Get a list of results in the Dictionary
NSArray *results = [dictionary objectForKey:@"GetAllFightersResult"];