Why won't my NSTextField update?

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

  1. macrumors 68000

    Joined:
    Nov 3, 2007
    #1
    I have made the connection in IB.

    Code:
    [onesLabel setTitleWithMnemonic:@"1"];
    and
    Code:
    [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

    kainjow

    Joined:
    Jun 15, 2000
    #2
    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. thread starter macrumors 68000

    Joined:
    Nov 3, 2007
    #3
    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

    Joined:
    Oct 29, 2006
    Location:
    Virginia
    #4
    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