Xcode 16 MacOS Sequoia SwiftData not saving data after running application

After upgrading to MacOS Sequoia and Xcode 16 my app was behaving oddly. While running the application from Xcode, the app appears to save data, but running the app again from Xcode, the data is not there. If I open the app on the iPhone, run it and create data, the data persists even after I kill the app from the app switcher.

I went many rounds through my code and found nothing that helped. I finally ran the sample app that appears when you begin a new project and that is behaving the same way. There are errors thrown.

error: the replacement path doesn't exist: "/var/folders/qv/m7sk8kcd3713j3l4bg8wt1lw0000gn/T/swift-generated-sources/@_swiftmacro_13SwiftDataTest11ContentViewV5items33_BCE1062261466603F5F86A688789BF68LL5QueryfMa.swift" error: the replacement path doesn't exist: "/var/folders/qv/m7sk8kcd3713j3l4bg8wt1lw0000gn/T/swift-generated-sources/@_swiftmacro_13SwiftDataTest11ContentViewV5items33_BCE1062261466603F5F86A688789BF68LL5QueryfMa.swift" error: the replacement path doesn't exist: "/var/folders/qv/m7sk8kcd3713j3l4bg8wt1lw0000gn/T/swift-generated-sources/@_swiftmacro_13SwiftDataTest11ContentViewV5items33_BCE1062261466603F5F86A688789BF68LL5QueryfMa.swift"

Same.

error: the replacement path doesn't exist: "/var/folders/2r/9jt0mn9119n3r4tj2qgff5s80000gq/T/swift-generated-sources/@__swiftmacro_18t<Blabla>_.swift"

Same here, has anyone filed a feedback or radar for Apple?

Not yet. I wanted to see if this was a thing first. I’ll do that tomorrow.

I run the SwiftData version of the Adopting SwiftData for a Core Data app sample app on macOS Sequoia 15.0 (24A335) with Xcode 16.0 (16A242d), and it doesn't demonstrate the issue you described. Would you mind to give it a try, and share the exact steps you use, if you do see the issue on your side?

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Xcode 16 MacOS Sequoia SwiftData not saving data after running application
 
 
Q