Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/108.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
Ios 为什么我的performsguewithidentifier最终没有返回按钮?_Ios_Objective C_Uiviewcontroller_Segue_Uisplitviewcontroller - Fatal编程技术网

Ios 为什么我的performsguewithidentifier最终没有返回按钮?

Ios 为什么我的performsguewithidentifier最终没有返回按钮?,ios,objective-c,uiviewcontroller,segue,uisplitviewcontroller,Ios,Objective C,Uiviewcontroller,Segue,Uisplitviewcontroller,出于某种原因,当我在add视图中使用Identifier执行搜索时,iPhone模拟器中缺少了back按钮 这是一个主细节应用程序模板,添加按钮将转到一个新的UIView。 整个演示正在进行中 程序点击 用户点击 我的添加视图在表控制器上调用以下代码: [self.navigationController popToRootViewControllerAnimated:NO]; //[self.navigationController popViewControllerAnimated:NO

出于某种原因,当我在add视图中使用Identifier执行搜索时,iPhone模拟器中缺少了back按钮

这是一个主细节应用程序模板,添加按钮将转到一个新的UIView。 整个演示正在进行中

程序点击

用户点击

我的添加视图在表控制器上调用以下代码:

[self.navigationController popToRootViewControllerAnimated:NO];
//[self.navigationController popViewControllerAnimated:NO];

NSIndexPath* selectedCellIndexPath = [NSIndexPath indexPathForRow:0 inSection:0];
[self.tableView selectRowAtIndexPath:selectedCellIndexPath animated:false scrollPosition:UITableViewScrollPositionMiddle];
[self performSegueWithIdentifier: @"showDetail" sender:[self.tableView cellForRowAtIndexPath:selectedCellIndexPath]];
但是,直接从表视图运行此代码不会产生问题


所以我不明白为什么iPhone上没有显示后退按钮。iPad版似乎工作得很好。

我尝试了几种不同的策略来解决我的问题

我发现最接近的方法是将add显示为一个模态,从segue到detail,unwind segue

它在iPad版本上仍然有点问题,添加按钮在添加时消失了,但比我原来的代码工作得更好


如果有人有更好的解决方案,那么我很乐意更改已接受的答案。

似乎segue不执行推送操作。请检查连接检查器中的segue操作。我克隆了您的repo并签出了您的代码。说实话,我觉得这一切都很混乱。我试图做出改变,但过了一段时间就放弃了。我认为带有“创建”按钮的“新细节视图”应该位于单独的导航控制器后面。在这种情况下,您不需要执行setReturnController和popViewController之类的操作。我在我的中做了类似的Segue设置,并在我的中详细介绍了我的方法。这是用斯威夫特写的,但我相信你会很容易理解的。因为改版效果很好。结果它打破了iPad的版本。看来我需要iPhone的展示和iPad的展示细节