使用json-framework在iphone应用程序中解析JSON [英] Parse JSON in iphone application with json-framework

查看:94
本文介绍了使用json-framework在iphone应用程序中解析JSON的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是iphone开发的新手。我在我的应用程序中使用货币转换器。
我不知道如何用这个网址解析json http://www.google.com /计算器?我想发送我的所有细节,如量化,选择货币,货币,并希望在标签中显示结果。请为我提供任何帮助或任何代码,我将如何解析这些数据。

I am new in iphone development.I am using currency converter in my apps. I don't have any idea how to parse json with this url http://www.google.com/calculator?. I want to send my all detail such as quantiy,select currency,to currency and wants to display the result in label. pls provide any help or any code for me how will i parse this data.

推荐答案

使用 SBJson

NSString *json = @"{lhs: "2 U.S. dollars",rhs: "89.7988506 Indian rupees",error: "",icc: true}"

NSDictionary *jsonDict = [json JSONValue];

NSString *lhs = [jsonDict objectForKey:@"lhs"];
NSString *rhs = [jsonDict objectForKey:@"rhs"];
...

这篇关于使用json-framework在iphone应用程序中解析JSON的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆