Hi, I've been attempting to learn Objective-C for around a month now and at the moment I am trying to make a simple vacaction money spending program.
I am trying to implement NSNumber & NSMutableArray into the program and I have run across an error when i go to build and run:
Code:
NSNumber *europeDollarTransaction = [[NSNumber alloc] initWithDouble:100.00];
NSNumber *europeDollarTransaction2 = [[NSNumber alloc] initWithDouble:200.00];
NSMutableArray *europeTransactions = [[NSMutableArray alloc] initWithCapacity:1];
[europeTransactions addObject:europeDollarTransaction];
[europeTransactions addObject:europeDollarTransaction2];
Budget *europeBudget = [Budget new];
[europeBudget createBudget: 1000.0 withExchangeRate: 1.2500];
for (NSNumber *aTransaction in europeTransactions) {
[europeBudget spendDollars: [aTransaction doubleValue]];
}
[europeBudget chargeForeignCurrency:numberEuros];
The error states "Incompatible type for argument 1 of spendDollars" after this line of code
Code:
[europeBudget spendDollars: [aTransaction doubleValue]];
Can someone explain what i've done wrong? Ill admit this is a really noobish question so sorry!
Also I have checked to see if I have misspelled anything/missed out simicolon..etc. but can't see anything
Thanks