I am new to this site, and also to iphone development. I am learning Objective-C through a few different books and through a Stanford University iOS development online class.
The current project is to build a calculator (already done), but now we have to add an array that keeps track of each operand or operation pressed. I tried to do this by adding a section of code with the "operationPressed" method and the "setOperand" method, but nothing gets added to the array.
In my .h file I declared an instance variable of NSMutableArray *internalExpression and this is the code for my .m file
- (void) setOperand: (double) anOperand
{
operand = anoperand;
NSNumber *currentOperand = [NSNumber numberWithFloat:operand];
[internalExpression addObject:currentOperand];
}
The set operand works, and currentOperand gets set correctly (checked using NSLog) yet nothing every gets added to the NSMutableArray (also checked using NSLog and the array count method).
What am I missing??
Thanks!
initor the equivalent)?