¡@

Home 

2014/10/15 ¤U¤È 10:11:36

iphone Programming Glossary: mutabledeepcopy

deep mutable copy of a NSMutableDictionary

http://stackoverflow.com/questions/1950361/deep-mutable-copy-of-a-nsmutabledictionary

in the dictionary is 'A' 'Adam' 'Apple'. Here's what I saw in a book but I'm not sure if it works NSMutableDictionary mutableDeepCopy NSMutableDictionary ret NSMutableDictionary alloc initWithCapacity self count NSArray keys self allKeys for id key in keys.. keys id oneValue self valueForKey key should return the array id oneCopy nil if oneValue respondsToSelector @selector mutableDeepCopy oneCopy oneValue mutableDeepCopy if oneValue respondsToSelector @selector mutableCopy oneCopy oneValue mutableCopy if.. key should return the array id oneCopy nil if oneValue respondsToSelector @selector mutableDeepCopy oneCopy oneValue mutableDeepCopy if oneValue respondsToSelector @selector mutableCopy oneCopy oneValue mutableCopy if oneCopy nil not sure if this is..

how to do true deep copy for NSArray and NSDictionary with have nested arrays/dictionary?

http://stackoverflow.com/questions/5453481/how-to-do-true-deep-copy-for-nsarray-and-nsdictionary-with-have-nested-arrays-di

and mutableCopy methods for NSArray and NSDictionary @interface NSArray SPDeepCopy NSArray deepCopy NSMutableArray mutableDeepCopy @end @interface NSDictionary SPDeepCopy NSDictionary deepCopy NSMutableDictionary mutableDeepCopy @end SPDeepCopy.m Created.. NSMutableArray mutableDeepCopy @end @interface NSDictionary SPDeepCopy NSDictionary deepCopy NSMutableDictionary mutableDeepCopy @end SPDeepCopy.m Created by Sherm Pendley on 3 15 09. #import SPDeepCopy.h @implementation NSArray SPDeepCopy NSArray.. so now we need to balance the above copies for unsigned int i 0 i count i cArray i release return ret NSMutableArray mutableDeepCopy unsigned int count self count id cArray count for unsigned int i 0 i count i id obj self objectAtIndex i Try to do a deep..