Hey, I am following along with Chris’ iOS Databases course Module 3 Lesson 9 – Adding the stats and have encountered an issue.
That is when I add a new update to the project, edit or delete one, the stats do not change in the project detail view. I need to reload it (go back to the list view and back again) for the stats to update and in the project list view, I need to restart the app for the stats to change. Why is this, Chris dosen’t behave like this… And more importantly, how do I fix it?
I followed along with the lesson and spent hours trying to solve but to no avail. Please could someone offer me assistance? Thanks in advance for your kind support.
Because my code is quite long I have put it on Github, it is clearer there, plus you can clone it. Here is the link
In I realise fact a similar error happened when I followed the same course Module 1 lesson 5 when I learned about relationships in SwiftData – the family list updates when I added a new family to swift data but when I added a member to a specific family, I needed to reload that view to make the changes take effect. Chris did this by updating a State property to make the UI change. This is not applicable in this context though.