Posts

Post not yet marked as solved
0 Replies
204 Views
iPad mini device with iPadOS 17.4.1. I get this failure on iPad mini device exclusively. I have universal app and I doesn't get this error neither on iPhone or any simulator or macOS. I tried to reset the iPad, still getting the error. The error happens when I send the app to background from the particular app screen. Here is the error: error: Store failed to load. <NSPersistentStoreDescription: 0x3004b4bd0> (type: SQLite, url: file:///dev/null) with error = Error Domain=NSCocoaErrorDomain Code=134060 "A Core Data error occurred." UserInfo={NSLocalizedFailureReason=The configuration named 'default' does not contain any entities.} with userInfo { NSLocalizedFailureReason = "The configuration named 'default' does not contain any entities."; } What error says is that it loaded the store from file:///dev/null, which is wrong. Basically it looses the model container which is added via modelContaner modificator to the root view. The error get caused particularly by the @Environment(\.modelContext) private var modelContext call in the view on which the failure occurs. This view is deep in the view hierarchy, and it get's created in the navigationDestination block. I fixed the error by supplying modelContainer one more time right on the view: .navigationDestination(for: File.self) { file in FileEditor(file: file) .modelContainer(FolderService.modelContainer) } I wonder, why can it loose the model container which is supplied on the root view?
Posted
by yukas.
Last updated
.
Post not yet marked as solved
0 Replies
164 Views
import SwiftUI import SwiftData struct ContentView: View { @Environment(\.modelContext) private var modelContext @Query private var folders: [Folder] @State private var currentFolder: Folder? @State private var currentPath: [Item] = [] var body: some View { NavigationSplitView { List(selection: $currentFolder) { ForEach(folders) { folder in NavigationLink(value: folder) { Text(folder.name) } } } } detail: { NavigationStack(path: $currentPath) { if let currentFolder = currentFolder { List(currentFolder.items) { item in NavigationLink(value: item) { Text(item.timestamp.ISO8601Format()) } } .navigationDestination(for: Item.self) { item in Text(item.title) .background(Color.blue) } } } }.onOpenURL(perform: { url in // Triggers by clicking on a widget let descriptor = FetchDescriptor<Folder>() // Randomly selecting a folder // In real app the url contains the folder and the item let folder = try? modelContext.fetch(descriptor).last if let folder = folder { currentFolder = folder // Triggering NavigationSplitView navigation works currentPath = [folder.items.last!] // Triggering NavigationStack navigation doesn't work } }) } private func addFolder() { // .. } } How to make programmatic navigation work?
Posted
by yukas.
Last updated
.
Post marked as solved
1 Replies
2.4k Views
I'm receiving this error: "Error returned from daemon: Error Domain=com.apple.accounts Code=7 "(null)"" in the console while trying to reverse geocode user's location. The reverse geocoding works OK, I receive the data, but the error in the console bothering me. Can someone suggest what the code 7 means here and how can I get rid of this error?
Posted
by yukas.
Last updated
.