Checklist Type Error? "Your Second Swift 4... To do list app"

I’m sure this is a dumb error: I’m about 2/3rd of the way through the “Your Second Swift 4… To do list app” class. So far, so good, until today. Code in video 39, about 3:30 in

When I went to create the handler for the delegate/segue (sorry, probably using the wrong terms", I got an error that traced back to ChecklistViewController.swift and specifically to the “prepare (for segue:” function. It works, and seems to handle the segues just fine, but some debugging (replacing lines with print() statements) revealed that the sender is coming across as type ChecklistItem instead of TableViewCell, and so none of the indexPath stuff will work.

Any idea on how I can get that fixed or where I went wrong?

Edit: Should ChecklistItem inherit from UITableViewCell or something?

Edit2: I’ve confirmed that the segue is coming from the “accessory action > show”.

Solved (I think)

Not sure how this happened, but the prototype cell contents needed to be set to type “UITableViewCell” again. Were they like that to start, and I just missed it? Don’t know, but the accessory now responds just fine.

@dclawson Thank you for sharing the solution - much appreciated! :]

This topic was automatically closed after 166 days. New replies are no longer allowed.