

Īgain, this works fine on Intel Macs if the user manually quits, as well as if the Intel Mac shuts down, but on Apple silicon, it only works if the user manually quits - a shutdown results in the app being terminated without even receiving a -applicationWillTerminate: call.īoth NSSupportsSuddenTermination and NSSupportsAutomaticTermination are disabled in the app's ist. So, is there any new API to extend the Mac's shutdown a little longer to finish my sync?Ĭurrently, I use -applicationShouldTerminate:, returning NSTerminateLater, and after syncing, calling -replyToApplicationShouldTerminate:YES. This still works on Intel Macs, as far as I know. However, on Apple silicon Macs, when the user shuts down or restarts the Mac and the app is terminated that way, the app is terminated right away (doesn't even receive the -applicationWillTerminate: call), so I'm unable to properly sync the status. This works on Intel Macs and on Apple silicon Macs when the user manually quits the app. So, in my app Transloader, when the app is terminated, I sync the Mac's "turned off" status to iCloud.
#Hstracker update how to
I can determine the row height myself easily enough, but I'm not sure how to tell the outline view that a given row's height needs to change in response to a disk or network adapter being added or removed. Also not sure how to tell the system to show the view from some XIB.Ĭould the problem be related to usesAutomaticRowHeights? I'm aware that hurts performance, but I don't know to what extent. I'm not sure how to build an NSTableView in interface builder (to get the NSTableCellView bindings and so on) without the scroll view and clip view around it. The top-level table rows should be tall enough objects are never hidden.

I specifically don't want a scroll view and a clip view inside the top-level table cells. Maybe instead of the SwiftUI stuff in the reusable views, I should be building an NSArra圜ontroller, an NSTableView with a single column, and using bindings and value transformers (to get an image from the text field indicating the resource's performance tier)? I'm not sure how to do that, though. Is there a better way to show a list of items with an image and a string of text per item inside a single NSOutlineView or NSTableView cell? For now, I have simplified that to a single icon for each:
#Hstracker update full
The full application has a set of different icons representing different types of disk and network for different performance tiers.

I have built a small example project with an object factory instead of an API connection. The hitches get far worse when I bump the number of columns up to the 20 or so I want to use in the real application. It also properly observes the disk/interface objects themselves for changes (e.g, renaming). View reuse is working, and the internal SwiftUI view properly observes the field for new or removed disks/interfaces. They then contain a SwiftUI VStack containing a ForEach which renders a row for each disk/interface. These views present an objectValue property, which gets modified as expected.

I have an NSView subclass for the disk column's views and the network adapter column's views. I originally built the NSOutlineView programmatically, but I've switched to building it in Interface Builder to get the NSTableCellView reuse behavior without needing to subclass and write my own implementations. Instruments tells me they are due to expensive commits. The problem I have is that when I scroll my outline, it has significant animation hitches. The VMs can be organized in folders, so I'm trying to use NSOutlineView bound to a tree controller to show the downloaded data. For example, a single VM can have several disks or several network adapters. They also have a few properties which are lists of relationships to other things. The VMs have a lot of simple properties like a UUID, a name, a comment field, a power state, and so on. I am building an application to show a list of VMs running under my account on a hosting provider. I'm targeting macOS 11 and up, running macOS 12.4 (21F79), and working with Xcode 13.4 (13F17a).
