0
标题基本上说明了一切;我想设置一个tableView的委托和数据源,我们将叫myTable
。我通常会做到这一点的方法是通过建立从故事板的出口连接表中,然后设置委托和数据源,如:设置UICollectionViewCell中的UITableView集的委托和数据源
@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? – Antoine
@Tander我想要的是有一个应用程序,将玩家列表分成可变数量的团队(根据他们的评分均匀分配)。我正在制作一个tableView的collectionView,这样我就可以根据所需团队的数量获得可变数量的表格,每个表格都包含玩家的名字。 (它自己的表不在collectionView中,但在collectionViewCell中,如果这是什么让你感到困扰) –