Hi everyone,
I’m building a simple sticky notes app that allows users to place a note widget on their home screen. Each widget displays a user-created sticky note.
To let users choose which note to show, I’ve implemented an Intent that presents a list of existing sticky notes. The list is built using IntentItems, and for each item I assign an image to visually represent the note.
Each sticky note can have a different background color and optional image, so I generate a small PNG (150×150, ~30 KB) and include it in the app bundle.
However, when I try to display the selection list, I get the following error:
The action Select sticky note could not run because an unknown error occurred.
If I tap OK and try again, the intent selector appears and works.
Here’s what I’d like to understand:
What could cause this unknown error when using images in IntentItems?
Are there known limitations on image size, source, or format for intent item images?
Can I supply a unique image per sticky note, or must all intent items share a common image?
Any guidance or insights would be greatly appreciated — I haven’t been able to find clear documentation about image handling in IntentItem for widget configuration.
Thanks!
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
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?
I have a SwiftUI + SwiftData (with iCloud) app. The setup code is standard, with schema migrations (mostly lightweight, one custom). Everything works correctly except in one scenario.
When I run a newer version of the app (with an updated schema adding one field + migration) on a device with the previous data container (the usual app version update through TestFlight), I encounter an issue on the first launch. The app crashes on the first "cold" start but runs successfully on subsequent launches.
The error I receive on the first run is:
addPersistentStoreWithType:configuration:URL:options:error: returned error NSCocoaErrorDomain (134060)
NSLocalizedFailureReason : Unable to find a configuration named 'default' in the specified managed object model.
What might be a problem and how to resolve it?
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?
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?
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
Xcode Sanitizers and Runtime Issues
Core Location
Accounts