PDA

View Full Version : Why won't my NSTextField update?




Jeremy1026
Mar 8, 2009, 06:00 PM
I have made the connection in IB.

[onesLabel setTitleWithMnemonic:@"1"];
and
[onesLabel setStringValue:@"1"];

both don't do squat. What are some debugging methods you would use to figure out why the label won't update?



kainjow
Mar 8, 2009, 06:34 PM
What method are you using this in? If it's from init then the nib hasn't loaded yet. I'd double-check your IB connection again.

Jeremy1026
Mar 8, 2009, 06:43 PM
What method are you using this in? If it's from init then the nib hasn't loaded yet. I'd double-check your IB connection again.

I'm doing the update in a method called newGame. Which is called from another file using [gmView newGame]; (I know this part works because of an NSLog.) What is weird though, is that putting the change code in the awakeFromNib (which gets called on the app start up) works.

eddietr
Mar 8, 2009, 07:36 PM
I'm doing the update in a method called newGame. Which is called from another file using [gmView newGame]; (I know this part works because of an NSLog.) What is weird though, is that putting the change code in the awakeFromNib (which gets called on the app start up) works.

In that case I would set a breakpoint in - newGame to see if in fact "onesLabel" is still a valid pointer to the correct NSTextField.