my codes:
@interface WindowController: NSWindowController{
IBOutlet NSWindow * window;
}
@implementation WindowController
-(id) init{
if(self = [super initWithWindowNibName"MyWindow"]){
// do something
}
return self;
}
-(id)initWithTitle: (NSString *) title{
[self init];
NSLog(@"window title before set is:%@",[window title]);
[window setTitle:title];
NSLog(@"window title after set is:%@",[window title]);
return self;
}
----------------------------------------------------------------------
The log shows that the title of the window is always 'null'. The IBOutlet 'window' is binding to a NSWindow object in IB which has an initial title name. why is the title 'null' before and after set? why the setTitle doesn't work?
@interface WindowController: NSWindowController{
IBOutlet NSWindow * window;
}
@implementation WindowController
-(id) init{
if(self = [super initWithWindowNibName"MyWindow"]){
// do something
}
return self;
}
-(id)initWithTitle: (NSString *) title{
[self init];
NSLog(@"window title before set is:%@",[window title]);
[window setTitle:title];
NSLog(@"window title after set is:%@",[window title]);
return self;
}
----------------------------------------------------------------------
The log shows that the title of the window is always 'null'. The IBOutlet 'window' is binding to a NSWindow object in IB which has an initial title name. why is the title 'null' before and after set? why the setTitle doesn't work?