How to开发者_StackOverflow社区 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.
You could use
newDict = [[NSDictionary alloc] initWithDictionary:oldDict copyItems:YES];
精彩评论