1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Why won't my NSTextField update?

Discussion in 'Mac Programming' started by Jeremy1026, Mar 8, 2009.

  1. macrumors 68000

    I have made the connection in IB.

    [onesLabel setTitleWithMnemonic:@"1"];
    [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?
  2. Moderator emeritus


    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.
  3. macrumors 68000

    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.
  4. macrumors 6502a

    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.

Share This Page