The Shape of Everything
A website mostly about Mac stuff, written by August "Gus" Mueller
» Acorn
» Retrobatch
» Mastodon
» Instagram
» Github
» Maybe Pizza?
» Archives
» Feed
» Micro feed
September 9, 2019

Daniel Jalkut: App Movement Monitoring:

"Essentially, when a Mac app is launched, the location of that app on disk is saved, and used repeatedly whenever an internal component needs to located. The dynamic nature of resource loading in Mac apps means that these components are not typically loaded until they are need. For example, if you never show the Preferences window in a typical Mac app, the resources that define that window will never be loaded.

"If, on the other hand, you decide to show the Preferences window, but you’ve moved the app since it was launched, things have a tendency to go haywire."

Daniel wrote this post after figuring out a crasher in NetNewsWire 5. And the solution he came up with is contained in a single source file you can embed in your Mac app, RSAppMovementMonitor. It's a good solution and I'll have to integrate it into Acorn and Retrobatch for their next updates.

But shouldn't the Finder prohibit moving an app while running in the first pace? I think so, and so does Paul Kafasis as he writes at Rogue Amoeba: The Finder Really Should Prevent Moving Running Applications.

Daniel also talks about his solution on episode 382 of the Core Intuition podcast.