The issue is for iOS 18 beta (Xcode 16.0 beta). The app behaves differently from iOS 17.5.
Line 50 context save was not required on iOS 17.5
With forced context save (line 50) on iOS 18 there is stale value in Text(item.answer)
(try alternating pressing Add and pressing on the row)
Post
Replies
Boosts
Views
Activity
Yes, this resolves app behavior, and is what changed between iOS 17.5 and iOS 18 beta. I need to call context save for every change now, instead of relying on autosaveEnabled:
When true, the context calls save() after you make changes to any inserted or registered models. The context also calls save() at various times during the lifecycle of windows, scenes, views, and sheets.