Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 自定义NSWindowController中的IBAction和IBOutlet_Objective C_Cocoa_Nswindowcontroller - Fatal编程技术网

Objective c 自定义NSWindowController中的IBAction和IBOutlet

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

我在Cocoa应用程序中设置了一个按钮,以打开一个新窗口。我的自定义窗口控制器声明为属性

@property (nonatomic, strong) MyWindowController *myWindowController;
当我的应用程序启动时,控制器被初始化

self.myWindowController = [[MyWindowController alloc] initWithWindowNibName:@"myWindow"];
单击该按钮时,将显示消息

[self.myWindowController showWindow:self];
已发送,窗口将显示。但是,当我向窗口添加视图时,我无法将它们连接到myWindowController中的iOutlet和iActions

摘要:如何设置myWindowController以处理myWindow中的事件

谢谢,
迈克尔·克努森解决了这个问题。必须将对象myWindowController设置为NIB文件的所有者。在界面生成器中单击它,并在Identity Inspector中进行更改