Group Group Group Group Group Group Group Group Group

V6 - Chapter 5 - Cell not updating when moving positions

At the end of chapter we work with Diffable data sources, and whenever the wins cause the cell to move up in position, it doesn’t update the Wins number nor does it deselect the cell (even if i’ve explicitly wrote it to). This only happens in the case that a cell is moving up in position, otherwise the cell updates the number of wins/deselects successfully. Why is this happening?

It looks like in the most recent update they forgot to mention to update the configure method. In the starter project its declaration is

func configure(cell: UITableViewCell, for indexPath: IndexPath) {

but in the final it’s

func configure(cell: UITableViewCell, for team: Team) {

The content of the method itself changed as a result too.

Also they incorrectly told us to add

let cell = tableView.cellForRow(at: indexPath) as! TeamCell
configure(cell: cell, for: indexPath)

at the end of the method tableView(_ tableView: UITableView, didSelectRowAt, when in their final project, they put it BEFORE saving the context

@cajeme Please check out the latest version of our Core Data book over here:

https://store.raywenderlich.com/products/core-data-by-tutorials

I hope it helps!