简体   繁体   English

使用动态数据进行JSON解析

[英]JSON Parsing with dynamic Data

Hey Everyone, My problem is,I want to parse this string using JSON 大家好,我的问题是,我想使用JSON解析此字符串
http://rate-exchange.appspot.com/currency?from=USD&to=EUR http://rate-exchange.appspot.com/currency?from=USD&to=EUR

but this is static that is it would convert from USD to EUR but what I want is the first parameter should be the one selected in first textField and the second from the second one.So that i can pass the commonISOCurrencyCodes(from the parameters selected in TF), to that string and get the result on click of a button on the Result TextField. 但这是静态的,它将从USD转换为EUR,但我想要的第一个参数应该是在第一个textField中选择的一个参数,而第二个则是从第二个textField中选择的一个参数,以便我可以传递commonISOCurrencyCodes(从在TF),然后单击“结果”文本字段上的按钮即可获得结果。

在此处输入图片说明在此处输入图片说明

Just as simple as: 就像这样简单:

NSString* fromCode = // from
NSString* toCode = // to
NSString* urlString = [NSString stringWithFormat:@"http://rate-exchange.appspot.com/currency?from=%@&to=%@", fromCode, toCode];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM