Bad API example: FileManager’s url(for:in:appropriateFor:create:)

I find FileManager‘s url(for:in:appropriateFor:create:) to be very unintuitive. It seems to have multiple, largely-orthogonal functions. It can provide paths to common folders (albeit badly). It can create temporary folders. It can locate volume-specific bins (Trash folders). It is an example of bad API design. Specifically, regarding cohesion: the principle that an API should have one… Read more

NSImage is dangerous

Screenshot of an excerpt from Xcode's debug console showing the output of AddressSanitizer, having detected data race involving NSImage.

NSImage is formally documented as largely not thread-safe: The following classes and functions are generally not thread-safe. In most cases, you can use these classes from any thread as long as you use them from only one thread at a time. Check the class documentation for additional details. Apple’s Threading Programming Guide > Appendix A:… Read more

Reminder: macOS system frameworks binaries are hidden (since Big Sur)

Every now and again I’ll go to do something really innocuous with an Apple framework, like disassemble it in Hopper or check the link headers. And every. single. time. I forget that Apple did some really weird shit in Big Sur, and removed the binaries. $ ls -lh /System/Library/Frameworks/AppKit.framework/Versions/Current/AppKit ls: /System/Library/Frameworks/AppKit.framework/Versions/Current/AppKit: No such file or… Read more

Mac app sandboxing interferes with drag & drop

Failed to get a sandbox extension Right from there, you know you’re going to have a bad day. 😔 Then you try to actually use the file dropped on your app, and you get: Upload preparation for claim 1C0F9013-4DEB-4E5D-8896-F522AA979BA6 completed with error: Error Domain=NSCocoaErrorDomain Code=513 ““Example.jpg” couldn’t be copied because you don’t have permission to… Read more

No more Dark Mode support

For about a month I was using WP Dark Mode. I don’t really recall how I thought upon it to begin with, but I vaguely recall choosing to install it because it seemed kind to support dark mode. Even though I don’t use it myself, it does seem to have a non-trivial following. And I… Read more

Apple’s timing problem

The M1 was announced in November 2020. The M1 Ultra wasn’t announced for another sixteen months, in March 2022. It was clearly late. Very late. The M2 was presumed right around the corner (and it was, released just four months later). Why would anyone buy an M1 Ultra, using a two year old CPU architecture… Read more