【发布时间】:2015-12-16 18:45:11
【问题描述】:
覆盖 func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cellIdentifier = "Cell"
let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath) as! CustomTableViewCell
// Configure the cell...
cell.nameLabel.text = restaurantNames[indexPath.row]
cell.thumbnailImageView.image = UIImage(named: restaurantImages[indexPath.row])
cell.locationLabel.text = restaurantLocations[indexPath.row]
cell.typeLabel.text = restaurantTypes[indexPath.row]
cell.accessoryType = restaurantIsVisited[indexPath.row] ? .Checkmark : .None
// Circular image
cell.thumbnailImageView.layer.cornerRadius = cell.thumbnailImageView.frame.size.width / 2
cell.thumbnailImageView.clipsToBounds = true
return cell
}
【问题讨论】:
-
如果我从 editActionsForRowAtIndexPath 函数中删除覆盖,我会收到冲突错误
-
您的方法签名很可能有错字。
标签: ios uitableview overriding