Skip to content

Instantly share code, notes, and snippets.

View wbarksdale's full-sized avatar

William Barksdale wbarksdale

View GitHub Profile
@yfujiki
yfujiki / Deep copy
Created January 23, 2012 18:48
Deep mutable copy category method of NSDictionary (ObjC)
- (NSMutableDictionary *) mutableDeepCopy {
NSMutableDictionary * returnDict = [[NSMutableDictionary alloc] initWithCapacity:self.count];
NSArray * keys = [self allKeys];
for(id key in keys) {
id oneValue = [self objectForKey:key];
id oneCopy = nil;
if([oneValue respondsToSelector:@selector(mutableDeepCopy)]) {
oneCopy = [oneValue mutableDeepCopy];