I am having a problem setting a label's value. I am detecting the number of moves in a game to in the class of my game piece I use mouseUp: to detect when a move occurs.
I use this code to calculate a move set a label equal to the move count, but it doesn't work:
movesCount is an int
movesLabel is a NSTextField connected to a label in Interface Builder.
I tested to see if the int is adding one each time and it is (I used an NSLog to confirm this.)
Why doesn't my label change to the value of movesCount?
I get no errors, but the label stays empty.
Thanks
I use this code to calculate a move set a label equal to the move count, but it doesn't work:
Code:
-(void)mouseUp:(NSEvent *)theEvent{
movesCount++;
NSString *movesCountString = [NSString stringWithFormat:@"%i",movesCount];
[movesLabel setStringValue:movesCountString];
}
movesLabel is a NSTextField connected to a label in Interface Builder.
I tested to see if the int is adding one each time and it is (I used an NSLog to confirm this.)
Why doesn't my label change to the value of movesCount?
I get no errors, but the label stays empty.
Thanks