Post

Replies

Boosts

Views

Activity

_dispatch_client_callout crash
I received the attached crash report. The problem is that the crash report does not contain the abort reason - it appears to be thrown in the GCD library with no additional information. Is it a possible deadlock? 2023-02-15_02-40-23.0077_+0100-94015bd052c4005658221a5e6279f28a75b9e92c.crash Any ideas?
5
0
2.3k
Mar ’25
NSDocumentController not adding "Open Recent" menu
I have a SwiftUI based app. For lots of reasons I was forced to use NSDocument instead of using DocumentGroup. I configure the main menu in my AppDelegate. It has the following code: let fileMenuItem = NSMenuItem() let fileMenu = NSMenu(title: "File") fileMenu.addItem(withTitle: "New", action: #selector(NSDocumentController.newDocument(_:)), keyEquivalent: "n") fileMenu.addItem(withTitle: "Open...", action: #selector(NSDocumentController.openDocument(_:)), keyEquivalent: "o") The New and Open work as expected. It is my understanding that the NSDocumentController should automatically add the "Open Recent" menu when it sees the Open action based on the NSDocumentController. It is not appearing. When I print the state of the recent documents using print("recent documents \(NSDocumentController.shared.recentDocumentURLs), maximum \(NSDocumentController.shared.maximumRecentDocumentCount)") I see the recent document urls and a count of 10. What can I do to make the menu appear? Thanks for the help.
5
0
247
Apr ’25
NSImageInterpolationNone no longer works in Big Sur
As the developer of Seashore, using [[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationNone]; no longer works as expected in Big Sur on a Retina display. The exact build works fine in Catalina. Small images seem to be first scaled using Medium or High interpolation to 2x, then scaled use 'None' to the desired size - causing blurriness. This the code to display and scale the image: [[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationNone]; [image drawInRect:alignedRect fromRect:copy operation:NSCompositeSourceOver fraction:1.0 respectFlipped:TRUE hints:NULL]; Any ideas for a fix?
Topic: UI Frameworks SubTopic: AppKit Tags:
2
0
816
Jul ’21
SwiftUI revert to saved loads document multiple times
Using, the standard Apple example at https://developer.apple.com/documentation/swiftui/building-a-document-based-app-with-swiftui I only made a small change to print when reading a file, with the time. When you use 'revert to saved', it writes the current version (expected), then loads the saved version (expected), then a few seconds later (not moving the mouse, edits, etc.) it reloads the document again. Then if you click away from the window, it loads it yet again - four times! This loading of the document twice breaks apps where the loading may take longer (large documents), then the document is replaced while the user has already started editing the recently loaded document. This is a really bad bug. Any ideas? Here is the added logs: reading file! testfile.story at 2025-03-11 20:35:16 +0000 saving file! testfile.story at 2025-03-11 20:35:27 +0000 reading file! testfile.story at 2025-03-11 20:35:27 +0000 reading file! testfile.story at 2025-03-11 20:35:30 +0000 reading file! testfile.story at 2025-03-11 20:35:31 +0000 I see the same behavior with 'Revert To Last Opened'. It seems to work as expected when you browse all versions and pick a specific version.
1
0
231
Mar ’25
how to make certain undo registrations not mark the document as edited
Hi. I thought the purpose of UndoManager.setActionIsDiscardable() was for this purpose - but the document still shows as edited. These changes like changing the zoom/viewing area should not cause the document to be considered edited - but you'd still like to be able to undo them. The documentation here https://developer.apple.com/documentation/foundation/undomanager/1415261-undoactionisdiscardable?changes=_6 even describes using it for just this purpose. If this isn't the method, how can I do this? Thanks.
Topic: UI Frameworks SubTopic: AppKit
1
0
150
Mar ’25
high internal cpu usage
Hi, I am developing a new SwiftUI app. Running under OSX, I see very high cpu usage (I am generating lots of gpu based updates which shouldn't affect the cpu). I have used the profiler to ensure my swift property updates are minimal, yet the cpu usage is high coming from SwiftUI. It seems the high cpu usage is coming from NSAppearance, specifically, CUICopyMeasurements - for a single button??? But the swift updates don't show any buttons being updating
Topic: UI Frameworks SubTopic: SwiftUI
0
0
268
Feb ’25
SwiftUI crash on OSX 26 using NSColorPanel
Crashlog-0916-071225.log I have an app that crashes on OSX 26 only. I have a @StateObject which is an observer of the NSColorPanel. When I call let panel = NSColorPanel.shared in init(), SwiftUI will crash - apparently with an update while view is being updated. See crash log. I was able to work around it by adding let _ = NSColorPanel.shared in my AppDelegate before SwiftUI is initialized. The exact code worked fine in all previous OSX versions.
0
0
79
Sep ’25