大家好,我是个刚学习COCOA编程的新手,目前正在对照《Cocoa.Programming.A.Quick-Start.Guide.for.Developers(Pragmatic.2010-4)》该书进行学习,在该书的《multiple nibs》章节中照着书上的例子实现,却不出效果,折腾了半天了,请大虾们帮帮我,不然后面的学习内容进行不下去了。
大体情况如下:
1,在默认的MAINMENU.XIB文件中把WINDOW删掉
2,新建一个WINDOWCONTROLLER和WINDOW XIB文件,并指定新WINDOW XIB的 FILE OWNER为WINDOWCONTROLLER
3.然后在程序代理类中添加@implementation HelloApplicationAppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 
    [[MyWindowController alloc] initWithWindowNibName:@\"MainWindow\"];
}
@end
4.在MyWindowController中重载该函数@implementation MyWindowController
-(id) initWithWindowNibName:(NSString *)windowNibName {
    if (self = [super initWithWindowNibName:windowNibName]) {
        [self showWindow:self]; 
}
return self; 
}
@end 
书上说这样的话,运行的时候回出现WINDOW的,但是我运行后,没有报错,但是也没有窗口出现。请帮帮我,谢谢!