开发者

send the user input to the xe.com and just fetch the result to display it in the program in objective c

开发者 https://www.devze.com 2023-01-10 18:44 出处:网络
i want to use just the result of any online currency converter as a variable in to my program. double amount_d;

i want to use just the result of any online currency converter as a variable in to my program.

    double amount_d;
amount_d=[amount doubleValue];

NSString *mar=[NSString stringWithFormat:@"http://www.xe.com/ucc/convert.cgi?   Amount=%d&From=%@&To=%@",amount_d,code1,code2 ];
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:mar]];

it opens like http://www.xe.com/ucc/convert.cgi?Amount=1&From=EUR&a开发者_JAVA技巧mp;To=USD

but i want to get only the result not the page, i don't have any idea about that & i'm beginner in objective c . or how can i get the currency rate table and use it in my program.

thanks.


They would need to provide you with an API to get the results only. What you (try to) do is a simple request, as any browser would do it and thus the get HTML code returned.

Moreover, according to their licensing page it seems you are only allowed to use their web snippet for free (or pay for licensing). You should look into their 'Advanced Converter Customization'.

Here is something you might want to consider instead: http://www.exchangerate-api.com/

0

精彩评论

暂无评论...
验证码 换一张
取 消