Post

Replies

Boosts

Views

Activity

Reply to NSAlert: Why are some buttons not drawn on Big Sur?
I came up with a workaround that seems to achieve the desired outcome. In addition to the buttons not drawing their backgrounds, there's a problematic line that appears after the 2nd button, presumably to set it apart from the cancel button. As a quick fix I just hide it, along with undoing the "draws only while mouse inside" setting that the frameworks have set: class HackAlert: NSAlert { @objc override func layout() { super.layout() for button in self.buttons { button.showsBorderOnlyWhileMouseInside = false } if let containerView = self.buttons.first?.superview { let boxes = containerView.subviews.compactMap { $0 as? NSBox } boxes.forEach { $0.isHidden = true } } } } Putting aside the question of whether it's right or wrong to work around this glitch, I do think this looks better, and it seems like a pretty safe way to achieve the desired outcome. It's important to make the tweaks in a subclass override of layout because that is where NSAlert seems to do all of its customizing of the UI before presentation.
Feb ’22
Reply to NSAlert: Why are some buttons not drawn on Big Sur?
I was wrong about the assumption that the container view is not being grown tall enough to give the buttons room. The problem is more insidious than that. Here I've arranged for the button container (a stack view) to be tall enough to show all the buttons and then some. You can see from the View Debugger screenshot that the actual visual glitch is rooted in the secondary buttons not having the "button bezel view" that the first button has. I've confrmed the bezel view is there but is set to hidden. The button and cell in this case are customized by NSAlert and are of class _NSAlertButton and _NSAlertButtonCell. So something is causing it to intentionally hide the bezel for these buttons but I agree it doesn't look good!
Feb ’22
Reply to NSAlert: Why are some buttons not drawn on Big Sur?
I suspect NSAlert is not expecting there to ever be more than 3 buttons. It looks like NSAlert does a lot of "just in time" relayout that includes bundling all the buttons/etc up in container views depending on the style of the alert. One of the internal methods -[NSAlert buildAlertStyle:title:formattedMessage:first:second:third:oldStyle:] sort of hints at this limitation.  The documentation for addButtonWithTitle: does suggest it supports more than three buttons, so I would say this is a bug. I suspect the container view holding the buttons is not being allowed to grow tall enough to contain them with the required padding.
Feb ’22
Reply to Mac App Store shows error: "Application is damaged, remove it and download again from App Store."
After seeing the public tweet about this issue I dug into it myself out of curiosity and because I was concerned my own receipt validation might be vulnerable to the problem. In my analysis I did find some dates that are now including milliseconds, but only in and undocumented field for the receipt file. If @depth42 is using the receipt file data for the "original purchase date" (not receipt download date), then that might explain it. Unfortunately this has never been exposed publicly through the receipt file format, though it is publicly exposed through the server-side receipt validation API.
Oct ’20
Reply to Linker error with XCTest.framework
I've noticed this as well and I don't think I've ever seen the issue before Xcode 12. The workaround suggested to ensure the test target uses a modern deployment target works well if the test target injects into a separate application target for testing, but when the test target itself compiles and links source files to be tested directly, it imposes the modern deployment target to the source files, which creates a different test environment than desired. I couldn't easily find an ld option to suppress the warnings about differing deployment target.
Jul ’20
Reply to VMware Fusion
FWIW I got it to work without incident after I re-created a new VMware instance with 10.15 and then upgraded to 11.0. I had problems trying to upgrade an older Mac VM, or trying to create a brand new 11.0 image based VM.
Jun ’20
Reply to Big Sur password problem
FWIW I got it to work without incident after I re-created a new VMware instance with 10.15 and then upgraded to 11.0. I had the same problem described here, where it wouldn't let me login, when I had previously tried updating from a well-used Mac VM.
Jun ’20