NSTextView setStringValue not Visible

  • Hello Folks,
    I'm working on my first Cocoa project - and pulling my hair out on this one.
    Any help would be appreciated.

    I'm writing a System Preference. During my mainViewDidLoad, I'm trying to
    set the text of a local TextField by doing a

            [theTextField setStringValue:@"test"];

    similar to the example at
    http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFPrefer
    ences/Tasks/UsingHighAPI.html

    in
    the mainViewDidLoad method.

    The text never appears until later if I call setStringValue after I show
    another sheet within the preference pane — then it appears. I'm NSLogging to
    make sure mainViewDidLoad was being called - it was.

    I've tried changing from mainViewDidLoad to willSelect, didSelect etc
    thinking maybe it had to do with the timing that I was calling
    setStringValue... No luck with any of them.

    Can anyone give me an idea of what I might be able to try?  Thanks.

    Joe
  • Hello Folks,
    I'm working on my first Cocoa project - and pulling my hair out on this one.
    Any help would be appreciated.

    I'm writing a System Preference. During my mainViewDidLoad, I'm trying to
    set the text of a local TextField by doing a

          [theTextField setStringValue:@"test"];

    similar to the example at
    http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFPrefer
    ences/Tasks/UsingHighAPI.html

    in
    the mainViewDidLoad method.

    The text never appears until later if I call setStringValue after I show
    another sheet within the preference pane — then it appears. I'm NSLogging to
    make sure mainViewDidLoad was being called - it was.

    I've tried changing from mainViewDidLoad to willSelect, didSelect etc
    thinking maybe it had to do with the timing that I was calling
    setStringValue... No luck with any of them.

    Can anyone give me an idea of what I might be able to try?  Thanks.

    Joe

    ------------------------------
    OK I figured out what was wrong based on a prior lists post from 2002!

    The correct answer is change the class of the File's Owner to my subclass of
    NSPrefPane then make connections to that.
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today