0
我正在设计一个3个自定义单元格的tableview。 我想通过添加唯一的附件类型来定制它们。 我已经crating一个tableViewController与静态单元格。每个单元格我都写了一个特殊的标识符和特殊类。我应该在tableView(_:cellForRowAtIndexPath :)方法中写入自定义单元格?
我的tableView基金应该如何为3个自定义单元格?
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let CityCellIdentifier = "CityTableViewCell"
let cell = tableView.dequeueReusableCellWithIdentifier(CityCellIdentifier, forIndexPath: indexPath) as! CityTableViewCell
// Configure the cell...
return cell
}
我应该为此创建三个单元变量吗?
http://stackoverflow.com/questions/14303832/uitableview-with-two-custom-cells-multiple-identifiers –
他的问题很快,你将他链接到一个客观的c问题 – Shades
你的意思是tableview最多包含3个(不同的)单元格,或者tableview会显示多个单元格,它们可以是3种不同的类型? – Kymer