Checklists - Adding and Editing Checklists (pg. 288) - Cancel and Done buttons not working

Hello all, I am currently working on the checklists tutorial and have hit a roadblock I can’t seem to figure out. I am on the steps right before source code #7 and everything works perfectly in the app except when adding a new checklist, the cancel and done buttons do not work.

The done button enables and disables based on whether there is text or not, but neither button dismisses the screen or alters the lists array as far as I can see. I have checked over the connections multiple times, even connecting and reconnecting them. I have compared my code with the next source code and nothing seems to be different. I would attach more pictures if I could. Any help would be appreciated!


EDIT: It seems to ONLY happen with adding a new list item. The cancel and done buttons work fine for the editing screen.

@fahim @hollance Could you please help with this one when you actually get a chance after all? Thank you - much appreciated! :]

Are the segue identifiers correct?

I only see code for the AddItem segue, not EditItem. So for the EditItem segue the delegate is not set, and the buttons do not do anything.

(Since you say the buttons work fine for the editing screen but not the adding screen, maybe the editing screen has the AddItem segue and the adding screen has the EditItem segue?)

Ahh, that was almost the problem but it sent me down the right path! There is no segue for the edit in this section of the book (it has me use the accessoryButtonTappedForRowWith) but the segue identifier was supposed to be AddChecklist, not AddItem. Thank you so much!

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