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
}
2 回答
只需从
editActionsForRowAtIndexPath
和commitEditingStyle
函数声明中删除override
字即可 .你应该分享你的全班 . 虽然,您似乎没有覆盖基类中的任何方法 . 从方法中删除
override
关键字,或者识别正确的BaseClass,其中存在具有相同签名(您想要覆盖的)的Overridable
方法,然后正确使用extends
关键字 .我认为你应该首先谷歌条款: MethodOverriding, BaseClass(or SuperClass)