> On Apr 3, 2021, at 12:00, Gabriel Zachmann via Cocoa-dev > <[email protected]> wrote: > > Oh, and BTW: what happens if I do this: > > NSDictionary * monitor_user_defaults = [ [NSUserDefaults standardDefaults] > dictionaryForKey: displayName_]; > [monitor_user_defaults setObject: anArray forKey: @"Pref1"]; > > Will that make NSUserDefaults automagically write the new > preferences/defaults to disk? > Will it notice that one of the dictionaries has changed?
No, get the dict, mutate it, and set it back into prefs. That’s why I suggested writing extensions on NSUserDefaults, which would do all this for you. Steve via iPad _______________________________________________ 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]
