When it does, though, macOS has painted you into a corner. Return to my example of the Finder, which thankfully seldom has serious problems with its preferences. Instead, macOS manages them with an opaque service cfprefsd, which isn’t remotely friendly, even to those comfortable in Terminal. To configure preferences, use the defaults command-line utility in macOS instead.” The sad fact is that UserDefaults and its preference files don’t have any common controls or utilities beyond the command shell interface. Modifying preference property list files may result in loss of changes, delay of reflecting changes, and app crashes. No sooner does Apple tell you that, than it’s issuing you a warning:ĭon’t try to access the preferences subsystem directly. Apparently it’s “an interface to the user’s defaults database, where you store key-value pairs persistently across launches of your app.” What’s known to the coder as UserDefaults has little regard for the user, and is all about customisation rather than defaults. In this era of absent documentation, we should be grateful that Apple’s developer reference on preferences is at least fairly complete, if paradoxical. If anything, in this respect it has grown worse. But why on earth should a Mac user have to resort to Terminal to try a popular remedy for a commonplace type of problem? After twenty years of evolution and revolution, hasn’t macOS advanced at all? “Trash ” was the good suggestion, followed quickly by the reminder that it’s better to use the defaults command tool instead. Last week they came up in the context of the bug I’m experiencing in the Finder, which occasionally forgets my main working folder and has to be restarted to restore its pride of place in my Finder windows. Apps crashing or failing to open at all, weird happenings in the Finder, soaring CPU load, or almost any sign of trouble and you can almost invariably find a cause stemming back to those property lists in a Preferences folder. There’s no other topic dating right back to the first release of Mac OS X which is so versatile in its ill-effects. If I’m ever short of a good item for a Q&A I can always rely on preferences.
0 Comments
Leave a Reply. |