Group Group Group Group Group Group Group Group Group

Checklist PDF code issue on page 368 "makeCell"

#1

On page 368 of iOS 7 PDF there is a line that states
let cell = MakeCell(for: tableView)
it sends up a red unresolved identifier alert. I do not see the need for this local scope line as the app builds without it. The full method code is below

override func tableView(_ tableView: UITableView,
cellForRowAt indexPath: IndexPath)
-> UITableViewCell {
let cell = makeCell(for: tableView)
// Update cell information
let checklist = lists[indexPath.row]
cell.textLabel!.text = checklist.name
cell.accessoryType = .detailDisclosureButton
return cell

#2

Sorry about that, the line that should be there is:

let cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier, for: indexPath)

You should find the correct code in the source projects included with the file. If in doubt, I’d suggest checking the source projects first :slight_smile:

5 Likes
#3

Thanks Fahim. It was fun to figure out. I thought I would send it in so that it could be added to changes required in the PDF version.

#4

Just hit the this part, it should be changed.

#5

@seanec @dthai93 Thank you for the heads up - much appreciated!

#6

correct me if I’m wrong please; but the fact that this error is in the book proves? that nobody bothered to proof read it before publication?

opened #8
#9

@chiangmai50000 We will fix this in the next version of the book. Thank you!