>> Is it enough then to take the dictionary I get back and do a [dict
>> mutableCopy]?
>> 
>> Will this cascade down to the "subdicts" (dicts within the top level
>> dict).
> 
> 
> No it won't.  mutableCopy only operates on one particular object and
> not all its contained objects.  While that behavior does sound nice in
> some situations, you'd definitely not want that in all situations.

So I am loading a dict from NSUserDefaults which says it is not mutable (but
the sub dictionaries are mutable in practice (might be just a OS bug)).

Root
   someKey    someDict (3 items)

   someDict
     keyA     dictA
     keyB     dictB
     keyC     dictC


Dicts A, B & C contain a bunch of string keys which I need to modify and
rewrite out to user defaults.

In Carbon I could do:

CFPropertyListCreateDeepCopy (kCFAllocatorDefault, localDict,
kCFPropertyListMutableContainersAndLeaves);

Is there a NSDictionary way to do this?

Trygve 


_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to