SwiftData modelContainer Error

It's been frustrating to solve this error. My iOS device and Xcode are fully updated. I can easily run app on simulator, but issue happens on my iPhone. dyld[23479]: Symbol not found: _$s9SwiftData12ModelContextC6insert6objectyx_tAA010PersistentC0RzlFTj Referenced from: <6FC773BB-E68B-35A9-B334-3FFC8B951A4E> Expected in: /System/Library/Frameworks/SwiftData.framework/SwiftData

Post not yet marked as solved Up vote post of meet__071 Down vote post of meet__071
674 views

Replies

I had a similar problem (different symbol, but similar) after upgrading to Xcode 15 b6, and a project clean fixed it.

  • Sounds like my issue, and found that this problem can occur after you've upgraded your macOS beta. I know this because I had a working app on a previous Xcode beta, and it was only until I updated my macOS beta that this problem occurred. See my issue here:

    [(https://developer.apple.com/forums/thread/734970)]

Add a Comment

I had something similar and I made my attributes optional; and the error was cleared .

@Model final class Item { var timestamp: Date? var title: String? var actualjournal: String? var time: String?

init(timestamp: Date, title: String, actualjournal: String, time: String) {
    self.timestamp = timestamp
    self.title = title
    self.actualjournal = actualjournal
    self.time = time
}

}