tags:

views:

29

answers:

1

How to make a deep copy of an NSDictionary, the easy way? In particular, it's an NSUserDefaults dictionary that contains only property list objects, so objects which are serializable.

Would I just iterate over it and build a complete new one with copied values? Guess you guys have a better solution.

+2  A: 

You could use

newDict = [[NSDictionary alloc] initWithDictionary:oldDict copyItems:YES];
Claus Broch