Reputation: 43
I don't know how to use the output=json;callback=
for my iPhone App, appreciate for your help!
This URL at tw.money.yahoo.com returns this JSON:
{"ResultSet":{"totalResultsAvailable":"0",
"Error":{"Code":400,
"Message":"\u67e5\u8a62\u53c3\u6578\u4e0d\u5408\u6cd5"}
}
}
Upvotes: 1
Views: 308
Reputation: 1751
jsonkit
NSDictionary *listings = [[content objectFromJSONString] valueForKey:@"ResultSet"];
Upvotes: 0
Reputation: 38475
If you get the response as a string, then it's very simple to parse - it just gets turned into NSDictionary and NSArray objects :)
Get the touch-json framework from github.
NSString *myJsonString = @"{'name':'Bob'}";
NSDictionary *dict = [myJsonString JSONValue];
After calling JSONValue on a string, dict will contain the key "name" that has the value "Bob".
Upvotes: 3