> Why not use your top level NSUserDefaults as a dictionary and use each > monitor name as a key for each object in the dictionary? Is that too clunky?
I was thinking of that, but I was hoping for a more elegant solution.
With the dictionary-per-monitor your suggesting,
I guess I would have to do something like this:
NSDictionary *monitor_dict = [NSDictionary dictionaryWithObjectsAndKeys:
displayname, defaultsForMonitor, nil ]; // where defaultsForMonitor is an
ancillary dictionary
[defaults registerDefaults: monitor_dict];
NSDictionary * monitor_user_defaults = [defaults dictionaryForKey:
displayname];
NSNumber * pref1num = [monitor_user_defaults valueForKey: @"Pref1"];
real_pref1_ = [pref1num intValue];
I.e., I don't get the nice NSUserDefaults machinery.
Plus, it's all or nothing, I can't have some preferences defined by the user
and some from the defaults.
Best regards, Gabriel
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Cocoa-dev mailing list ([email protected]) 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 [email protected]
