PDA

View Full Version : Getting info from the web to xcode app




j-mods
Aug 8, 2012, 05:14 AM
Hi

I want to get the exchange rate for the pound verses the dollar from the web and insert it into my convert code. This is my code and as you can see, at the moment the user has to enter the exchange rate themselves into the equation.

@implementation exchange

-(void)awakeFromNib {
[dollarsTextField setFloatValue:0.0];
[poundsTextField setFloatValue:0.0];
[exchangeRateTextField setFloatValue:0.0];
}

-(IBAction)convert: (id)sender {
if ( sender == poundsTextField ) {
float poundsPrice = [poundsTextField floatValue];
float exchangeRatePrice = [exchangeRateTextField floatValue];
[dollarsTextField setFloatValue: (poundsPrice*exchangeRatePrice)];
}
else if ( sender == dollarsTextField ) {
float dollarsPrice = [dollarsTextField floatValue];
float exchangeRatePrice = [exchangeRateTextField floatValue];
[poundsTextField setFloatValue: (dollarsPrice/exchangeRatePrice)];
}
}
@end


I want it so when the user enters how many pounds they want converted or vice versa, it will run the get info code, input that to this code then run this code, meaning that you always have an upto date exchange rate (I know this is slower than say finding it and keeping it the same until the session ends, but I really need accuracy with this).

Thanks

Julian



softwareguy256
Aug 8, 2012, 05:21 AM
You need to buy a data feed. Market data is not free. If you ever plan to distribute this app you are going to get a correspondence from a lawyer at some point for theft.

Hi

I want to get the exchange rate for the pound verses the dollar from the web and insert it into my convert code. This is my code and as you can see, at the moment the user has to enter the exchange rate themselves into the equation.



I want it so when the user enters how many pounds they want converted or vice versa, it will run the get info code, input that to this code then run this code, meaning that you always have an upto date exchange rate (I know this is slower than say finding it and keeping it the same until the session ends, but I really need accuracy with this).

Thanks

Julian

j-mods
Aug 8, 2012, 05:31 AM
Thanks

How would I go about buying a data feed?

Julian