So I have a web service that returns this JSON:
[{"other_user":"54","distance":"1 ft","duration":"1 min"},{"other_user":"55","distance":"2 ft","duration":"5 min"}]
Then in my ios app I use:
NSString *responseString = [request responseString];
NSArray *responseArray = [responseString JSONValue];
for (NSDictionary* item in responseArray) {
NSString *otherUser = [item objectForKey:@"other_user"];
NSString *otherDistance = [item objectForKey:@"distance"];
NSString *otherDuration = [item objectForKey:@"duration"];
NSLog(@"user: %@ distance: %@ time: %@", otherUser, otherDistance, otherDuration);
}
but I am getting this error:
-JSONValue failed. Error is: Illegal start of token [S]
Any help is appreciated, I have no Idea where to look/debug
responseString. I'm guessing it's not valid JSON.