【发布时间】:2015-11-05 21:48:43
【问题描述】:
标题基本上说明了一切;我想设置我们将调用myTable 的tableView 的委托和数据源。我通常这样做的方法是从情节提要建立与表的出口连接,然后设置委托和数据源,如下所示:
@IBOutlet weak var myTable: UITableView!
override func viewDidLoad()
{
super.viewDidLoad()
myTable.delegate = self
myTable.dataSource = self
}
但是,由于我的表位于 UICollectionView 的单元格内,我收到了错误 "The myTable Outlet from the myCollectionViewController to the UITableView is invalid. Outlets Cannot be connected to repeating content"
我理解错误,但我的问题是;既然我常用的方法不可用,我该如何设置委托和数据源。
【问题讨论】:
-
你实现了 UITableViewDatasource 和 UITableViewDelegate 了吗?
-
@Tander 我想要的是有一个应用程序,可以将玩家列表分成不同数量的团队(均匀地,根据他们的评分)。我正在制作 tableViews 的 collectionView,以便我可以根据所需的团队数量拥有可变数量的表格,每个表格都包含球员姓名。 (它自己的表不在collectionView中,而是在collectionViewCell中,如果这就是困扰你的话)
标签: ios uitableview delegates uicollectionview swift2