iPhone:如何查找货币换算?

发布于 2024-10-03 11:01:11 字数 176 浏览 0 评论 0原文

我想在我的 iPhone 应用程序中执行货币换算。

抛开数字格式或货币符号的问题,如何将 X USD 转换为 Y CAD(或类似货币)?

我知道谷歌和雅虎!有处理此类事情的 API,我只是缺乏从我的应用程序访问它的知识。

任何代码或示例的 URL 都会很酷。

谢谢, 戴夫.

I'm wanting to perform currency conversions in my iPhone app.

Putting aside the issues of number formatting or currency symbols, how do I convert from X USD to Y CAD (or similar)?

I know Google and Yahoo! have APIs which deal with this kind of thing, I just lack the knowledge to access it from my app.

Any code or URLs to examples would be cool.

Thanks,
Dave.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蓦然回首 2024-10-10 11:01:11

http://betterexplained.com/articles/using-json-to-exchange-数据/

这有帮助吗?滚动到货币转换内容,其中提到了返回 XML 的数据源。然后,您可以使用 NSXML 解析器来解析结果,

也检查一下这个,看起来非常简单:

http://www .exchangerate-api.com/

http://betterexplained.com/articles/using-json-to-exchange-data/

does that help? scroll to the currency conversion stuff there where there's a datasource mentioned which returns XML. You may then use the NSXML parser to parse the results

check this one as well, looks dead simple:

http://www.exchangerate-api.com/

这个俗人 2024-10-10 11:01:11

感谢您的链接,我能够通过以下行获得我需要的结果:

label.text = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"http://www.exchangerate-api.com/USD/GBP/100?k=<<API KEY>>"]
                                      encoding:CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000)
                                         error:NULL];

Thanks for the links, I was able to get the result I need with the following line:

label.text = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"http://www.exchangerate-api.com/USD/GBP/100?k=<<API KEY>>"]
                                      encoding:CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000)
                                         error:NULL];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文