我有一个 UICollectionView 是用来展示搜索结果的,在这个的上头还有一个搜索框。现在我想点击 UICollectionView 的一个元素跳到另一个 controller ,暂且称为目的 controller 。当前的 controller 是 UIViewController ,功能是搜索,是从另一个 ViewController 的 navigationController push 出来的。我可以在当前的搜索 controller 里面使用 navigationController 的 pushViewController 的形式完成上述功能,但是等我返回的时候,上述的搜索框就已经不在了!!!!!。。。。我想这应该是搜索框不属于 navigationControllerd 的原因。现在的问题是,我用的方法是程序加载 xib 文件生成的搜索 controller ,不是通过 storyboard ,无法显示设计 segue ,能不能通过代码完成类似 segue 的功能,然后还不会出现上述搜索框消失的问题。。。。