CrashReportError: Fatal Error in PersistentModel.swift

I got a preview crash info as this: *** crashed due to fatalError in PersistentModel.swift at line 559.

This KeyPath does not appear to relate RecordInfo to anything - \RecordInfo.<computed 0x00000001921dfb4e (Array<SomeInfo>)>

If I change preview device to iPhoneSE, It is no crash.

I think the reason is I have some dirty data in iPhone16 Pro preview device. If I'm right and how to delete it?

Model of RecordInfo like this:

@Model
class RecordInfo {
    @Relationship(deleteRule: .cascade) var someInfo:[SomeInfo]
}

@Model
class SomeInfo {
    var date: Date
    var info: String
}
Answered by Developer Tools Engineer in 815797022

you can clear out all the preview devices and their caches using xcrun simctl --set previews delete all

Accepted Answer

you can clear out all the preview devices and their caches using xcrun simctl --set previews delete all

CrashReportError: Fatal Error in PersistentModel.swift
 
 
Q