Deletes are not persisted & picker bug on second touch
Opened this issue · 1 comments
thanks for this tutorial, I found 2 bugs while doing it ...
The delete order does not work, if you restart the app then the order reappears ..
I tried to save the context but I got a crash while doing it ...
The second bug is in the Order Sheet, while selecting your Pizza Type from the Picker,
if you try to rechange your selection, the table row gets highlighted and freeze, the picker values are now showed, looks like a SwiftUI bugs
Alex
The bug in changing pizza type seems to be fixed. Works for me today as expected. Was able to change pizza type once or multiple times and got correct results.
Adding a save of the managed object context after the delete for-loop works for me.
.onDelete { indexSet in for index in indexSet { self.managedObjectContext.delete(self.orders[index]) } try? self.managedObjectContext.save() }