So, since I updated to Xcode 16.1 and iOS 18, my SwiftData project who relies on autosave doesn't work as expected.
Indeed, it works but only after a delay, around 30 seconds.
So if I add something to the database, I must wait around this delay to quit and relaunch the app, to see the changes persist.
I researched but didn't find any fix, besides using context.save() but since the method can throw errors, I cannot find exactly what errors and so, how to react to them.
If you have a solution, or just an idea, please let me know :)
Thanks a lot guys.
print(error)in the catch to start with to determine what error you get? Then you can add better error handling later on but that is another issue. That said if your call to save() throws an error then the automatic save will also generate an error or there is something wrong with how you save. But again this is another issue.