Help with pointers in Cocoa

Posted by G.P. Burdell on Stack Overflow See other posts from Stack Overflow or by G.P. Burdell
Published on 2010-06-10T23:34:55Z Indexed on 2010/06/10 23:53 UTC
Read the original article Hit count: 343

Filed under:
|
|
|
|

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.

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about cocoa