Objective c 自定义NSWindowController中的IBAction和IBOutlet
我在Cocoa应用程序中设置了一个按钮,以打开一个新窗口。我的自定义窗口控制器声明为属性Objective c 自定义NSWindowController中的IBAction和IBOutlet,objective-c,cocoa,nswindowcontroller,Objective C,Cocoa,Nswindowcontroller,我在Cocoa应用程序中设置了一个按钮,以打开一个新窗口。我的自定义窗口控制器声明为属性 @property (nonatomic, strong) MyWindowController *myWindowController; 当我的应用程序启动时,控制器被初始化 self.myWindowController = [[MyWindowController alloc] initWithWindowNibName:@"myWindow"]; 单击该按钮时,将显示消息 [self.myWin
@property (nonatomic, strong) MyWindowController *myWindowController;
当我的应用程序启动时,控制器被初始化
self.myWindowController = [[MyWindowController alloc] initWithWindowNibName:@"myWindow"];
单击该按钮时,将显示消息
[self.myWindowController showWindow:self];
已发送,窗口将显示。但是,当我向窗口添加视图时,我无法将它们连接到myWindowController中的iOutlet和iActions
摘要:如何设置myWindowController以处理myWindow中的事件
谢谢,
迈克尔·克努森解决了这个问题。必须将对象myWindowController设置为NIB文件的所有者。在界面生成器中单击它,并在Identity Inspector中进行更改