Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.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
Macos NSPopover开关视图_Macos_Nsviewcontroller_Nspopover - Fatal编程技术网

Macos NSPopover开关视图

Macos NSPopover开关视图,macos,nsviewcontroller,nspopover,Macos,Nsviewcontroller,Nspopover,我有一个popover menulet,它的contentViewController是一些NSViewController。这里一切都好。我的问题是我真的不明白如何改变观点。我想加载另一个视图,这是我尝试的: popover = [[NextViewController alloc]initWithNibName:@"NextViewController" bundle:nil]; [self.view addSubview:[popover view]]; 这样,新视图就会显示出来,但若我

我有一个popover menulet,它的contentViewController是一些NSViewController。这里一切都好。我的问题是我真的不明白如何改变观点。我想加载另一个视图,这是我尝试的:

popover = [[NextViewController alloc]initWithNibName:@"NextViewController" bundle:nil];
[self.view addSubview:[popover view]];
这样,新视图就会显示出来,但若我点击该视图上的任何按钮,就会得到错误:无法识别的选择器被发送到实例。为什么我会犯这个错误?为什么这个新观点没有反应


请帮助我了解我需要做什么,如何在nspover上更改视图?

我已经设法解决了我的问题,结果很简单:

[self.view setSubviews:[NSArray array]]; //remove all previous subviews
[self.view addSubview:[popover view]];