开发者

How to make a deep copy of an NSDictionary, the easy way?

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];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜