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
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