简体   繁体   English

uiTableView中的许多视图控制器

[英]Many view controllers from uiTableView

How to make in xcode 5 many viewControllers connected with one cell in UITableView? 如何在Xcode 5中使许多与UITableView中的一个单元连接的viewControllers? I'd like to make this because every cells are deferent (1) with photo, 2) with UIWebView, 3) viewController). 我想这样做是因为每个单元格都不同(1)带照片,2)带UIWebView,3)viewController)。 After user taps on cell system must know which UIController it should fire up. 用户点击单元系统后,必须知道应启动哪个UIController。 For better view I've attached screenshot. 为了获得更好的视图,我附加了屏幕截图。 How to make it all with storyboard? 如何使用情节提要进行所有操作?

在此处输入图片说明

How to connect this three controllers to one table cell? 如何将这三个控制器连接到一个表格单元?

You can't connect more than one segue to a cell. 您不能将多个segue连接到一个单元。 If you need to go to one of a number of controllers based on which cell you select, you should make the segues from the controller itself, and then use logic in didSelectRowAtIndexPath to decide which segue to perform. 如果您需要根据选择的单元格转到多个控制器之一,则应从控制器本身进行选择,然后使用didSelectRowAtIndexPath中的逻辑来决定要执行哪个选择。 You can connect as many segues as you want from the controller, and when they're set up that way, you have to initiate them by calling performSegueWithIdentifier:sender:. 您可以从控制器连接任意数量的序列,当以这种方式设置它们时,您必须通过调用performSegueWithIdentifier:sender:来启动它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM