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 在UIPopOver处于活动状态时将第一响应者发送给UISegmentControl?_Objective C_Uipopovercontroller_Uisegmentedcontrol - Fatal编程技术网

Objective c 在UIPopOver处于活动状态时将第一响应者发送给UISegmentControl?

Objective c 在UIPopOver处于活动状态时将第一响应者发送给UISegmentControl?,objective-c,uipopovercontroller,uisegmentedcontrol,Objective C,Uipopovercontroller,Uisegmentedcontrol,遇到问题,我的搜索结果一无所获。我有一个应用程序,我需要一个段控制对象(在启动popover的VC上),当我有一个popover处于活动状态时,它可以保持活动和可触摸。这可能吗 编辑: 解决方案如下: self.myPopOver.passthroughViews = [[NSArray alloc] initWithObjects:_segPopOverControl, nil]; 必须初始化popover的passthroughview,因为还没有使用。将UISegmentedContro

遇到问题,我的搜索结果一无所获。我有一个应用程序,我需要一个段控制对象(在启动popover的VC上),当我有一个popover处于活动状态时,它可以保持活动和可触摸。这可能吗

编辑: 解决方案如下:

self.myPopOver.passthroughViews = [[NSArray alloc] initWithObjects:_segPopOverControl, nil];

必须初始化popover的passthroughview,因为还没有使用。将UISegmentedController添加到列表中,效果很好。

将其添加到popover控制器的
passthroughview
属性中

NSArray *oldPassthroughViews = myPopoverController.passthroughViews;
myPopoverController.passthroughViews = [[NSArray
    arrayWithArray:myPopoverController.passthroughViews]
    arrayByAddingObject:mySegmentedControl];

我明白了。谢谢你,先生。需要一点变化,但你引导我走上了正确的道路。干杯。“self.myPopOver.passthroughViews=[[NSArray alloc]initWithObjects:\u segPopOverControl,nil];”基本上,passthrough视图中没有任何对象,因此只需取出旧的passthrough部分,并使用segmentedController初始化视图数组