Help with pointers in Cocoa
- by G.P. Burdell
I'm trying to make a simple calculator application in cocoa. The program hangs when I click on one of my buttons. I think I've traced the problem to the part of my controller that adds a digit to the end of the number currently on the display:
- (void)updateNumber:(int)buttonClicked{
*self.activeNumberPointer = *self.activeNumberPointer * 10 + buttonClicked;
[outputField setFloatValue:*self.activeNumberPointer];
}
I used a pointer to the "activeNumber" in order to allow my program to tell which of the two operands I'm editing.
Any help appreciated, thanks.