Post

Replies

Boosts

Views

Activity

SwiftUI Settings scene (Preferences): how call action when closed by user (click on red button or Cmd-W)
Hi, I thought this should be quite easy and maybe I only have tomatoes on my eyes, but I cannot find out how to call an action when the user clicks the red button or use CMD-W to close the Preferences window (= Settings Scene). I use Core Data. In the Preferences, many data structures, which define my system, are changed. I learned, that you shouldn't save too often to avoid performance problems, so now I want to save the Core Data context when the user closes the Preferences window. I tried .onDisappear, onChange of focus etc. but this didn't work. How can I define an action? Any hints are welcome :-)
2
0
1.6k
Apr ’24
SwiftUI CloudKit App crashes at start with "Unable to load nib file: MyApp, exiting"
I'm developing a SwiftUI App for macOS in Xcode 13.2. When I try to run the App in Xcode, I get this error messages in the console and the app terminates: 2021-12-28 13:13:21.680087+0100 MyAppProject[21343:363165] [CK] Giving up waiting to register for remote notifications 2021-12-28 13:13:23.548389+0100 MyAppProject[21343:362383] Unable to load nib file: MyAppStartViewName, exiting Until now, the error happend sporadically. Now I use a new MacBookPro with M1max and the error happens every time. As it is a SwiftUI App, there is no nib file at all. I didn't find any information about SwiftUI generating a nib file... How can I prevent the bug and get the App running? Any hints are welcome :-)
3
0
1.4k
May ’22