swift:22: Fatal error: Could not create ModelContainer: SwiftDataError(_error: SwiftData.SwiftDataError._Error.loadIssueModelContainer)
Post
Replies
Boosts
Views
Activity
Still there:
import SwiftData
@main
struct ForeCashApp: App {
var sharedModelContainer: ModelContainer = {
let schema = Schema([
Transaction.self,
])
let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false)
do {
return try ModelContainer(for: schema, configurations: [modelConfiguration])
} catch {
fatalError("Could not create ModelContainer: \(error)")
}
}()
var body: some Scene {
WindowGroup {
NavigationStack {
TransactionsScreen()
}
}
.modelContainer(sharedModelContainer)
}
}