小编Ebi*_*in 的帖子

我如何修复"方法不会覆盖其超类中的任何方法."?

override 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
}
Run Code Online (Sandbox Code Playgroud)

overriding uitableview ios

7
推荐指数
1
解决办法
3249
查看次数

标签 统计

ios ×1

overriding ×1

uitableview ×1