I'm trying to parse this JSON that looks to me like well written, but NSJSONSerialization
doesn't think the same AFAIK since it's returning an NSArray
.
This is my code:
NSData* gamesData = [NSData dataWithContentsOfURL:
[NSURL URLWithString:@"http://s42sport.com/polarice/json/games.json"]
];
NSDictionary* json = nil;
if (gamesData) {
json = [NSJSONSerialization
JSONObjectWithData:gamesData
options:kNilOptions
error:nil];
NSLog(@"%d",json.count);
}
The questions are,
What's wrong with the JSON? Why NSSerialization doesn't return me the NSDictionary?
Edit: Yes, I just learned about the [...] vs {...}. Thank You.