prepareForSegue未在嵌入式segue中调用 [英] prepareForSegue not called in embedded segue

查看:150
本文介绍了prepareForSegue未在嵌入式segue中调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在视图控制器的容器中嵌入了一个表视图控制器。

I have a table view controller embedded in a container in a view controller.

在视图和表视图控制器中,prepareForSegue方法我把NSLog(@控制器名称)
我看到了视图控制器的日志但是不是表视图控制器。我不应该看到我的表视图的preparelog的nslog吗?

In both the view and table view controllers prepareForSegue method I put NSLog(@"name of the controller") I see a log for the view controller but not the table view controller. Shouldn't I also see the nslog for my table view's prepareForSegue?

推荐答案

在您的日志框架视图控制器中,prepareForSegue将在initWithCoder之后直接调用:准备你的TableViewController。我无法在表视图控制器和另一个视图(右侧视图)之间看到您的连接,但我相信当您点击该行时将会调用它。

In Your Log Frame View Controller prepareForSegue will be called directly after initWithCoder: to prepare your TableViewController. I cannot see your connection between table view controller and another view (view on the right) but I believe it will be called when you hit the row.

// EXTENDED

//EXTENDED

另一件事可能是您没有在视图层次结构上添加UINavigationController并将segue样式设置为push。尝试在属性检查器中将segue的样式更改为模态。
希望得到这个帮助。

The other thing could be that you haven't add UINavigationController on the view hierarchy and you set up your segue style to 'push'. Try change style of your segue to 'modal' in attribute inspector. Hope this help.

这篇关于prepareForSegue未在嵌入式segue中调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆