connections and the nib lifecycle
connections and the nib lifecycle
- Subject: connections and the nib lifecycle
- From: Torsten Curdt <email@hidden>
- Date: Wed, 21 May 2008 18:05:30 +0200
I have a class that extends NSWindowController. I instantiate and call
it like this
MyWindowController *controller = [[MyWindowController alloc] init];
[controller test:@"test"];
The NIB has the textField connected. Here is the (simplified)
implementation of the controller.
- (id) init
{
self = [super initWithWindowNibName:@"SomeOther"];
return self;
}
- (void) awakeFromNib
{
NSLog(@"nib loaded.");
}
- (void) windowDidLoad
{
NSLog(@"window loaded.");
}
- (void) test:(NSString*)string
{
[textField setStringValue:string];
NSLog(@"textField=%@", textField);
int ret = [NSApp runModalForWindow:[self window]];
NSLog(@"textField=%@", textField);
Looking into the test method. Why on earth is the textField nil first
and only after the runModalForWindow holds the proper reference??
I've already gotten the awakeFromNib and even the windowDidLoad message!
I am confused. Any wise words?
cheers
--
Torsten
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden