NSTextField will not set StringValue

I am just starting a fairly simple application (not quite what it is in Object C yet) with NSWindow containing an NSTextField. In appdelegate.h there is the following:

NSWindow *window;
NSTextField *userIDText;

@property (nonatomic, retain) IBOutlet NSWindow *window;
@property (nonatomic, retain) IBOutlet NSButton *nextButton;
@property (nonatomic, retain) IBOutlet NSTextField *userIDText;

appdelegate is connected in the Interface Builder to the window and text field, and then in the .m file:

@synthesize userIDText;

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    [userIDText setStringValue:@"user"];
    NSLog(@"UserIDTextString: %@", [userIDText stringValue]);

(I tried other things besides @ "user" as a string) Only null is displayed in the log, and the text field does not change. What am I doing wrong? I search the internet for about 5 hours, and this is clearly something really very simple that I miss.

+5
source share
2 answers

applicationDidFinishLaunching . NSLog(@"UserIDTextString: %@", [userIDText stringValue]); . awakeFromNib.

+2

, . , .. "MainMenu.xib", " ", " " .

, . , - , .

!

+1

All Articles