Gabriel > On Apr 3, 2021, at 10:55, Gabriel Zachmann <z...@cs.uni-bremen.de> wrote: > > >> >>> >>> [ [NSUserDefaults userDefaultsWithName:@"monitor-name"] boolForKey:@"some >>> key"] >> >> I thought -addSuiteNamed: would allow you to maintain/add a suite of >> defaults for each monitor. > > Maybe. > > The doc says: > > """ > The suiteName domain is similar to a bundle identifier string, but isn't > necessarily tied to a particular application or bundle. A suite can be used > to hold preferences that are shared between multiple applications > """ > > So, I think, it is meant for app groups.
App groups, I believe, were introduced in 10.7. The -addSuiteNamed: API has been around since 10.0. > > What I don't get is this sentence in the doc: > > "The additional search lists of the suiteName domain are searched after the > current domain..." I believe that just means that your app’s Domain is searched first, and any common keys would mask out keys in your suite. > > And I'd rather understand exactly what my code is doing than guessing what it > might do. Doesn’t seem mysterious… and would allow you to maintain a suite for each monitor type which could be loaded and unloaded as you detect the presence of a monitor, or based on which monitor your app is running on. As long as your suite keys had a prefix they’d never collide with keys in you app’s main defaults domain. Best Regards, Sandor > > > > Best regards, Gabriel > _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com