Checklists (p.243): itemID doesn't display properly all the time

I have the code correctly. When I create new checklists the itemID is generated correctly and it saves when I go to the home screen. If I tap the app on the simulator, the app opens and displays all the correct itemIDs. However, if I go to the home screen and run the app again from Xcode it resets all previous itemIDs to 0.

Is there something I’m missing?
I just want to make sure I’m understanding the problem.

Thanks!

That sounds like something is missing indeed, but from your description I’m not 100% sure what.

What exactly do you mean by “resets all previous ItemIDs to 0”?

Do you mean that when the checklist items are loaded back in from the plist file, their old ItemIDs are erased and are now 0?

If that is the case, then it sounds like init?(coder) in ChecklistItem.swift may not be loading the ItemID property correctly.

I swear I went over every line of my code.
But, I made a simple error in the init?(coder). I had “itemID” instead of “ItemID”.
Can’t believe I missed that :unamused:

Thanks for letting me know where to look!