30- (void)mergeEntriesFromDictionary:(NSDictionary*)otherDictionary
32 NSEnumerator* otherKeysEnum =
nil;
35 for (otherKeysEnum = [otherDictionary keyEnumerator]; (key = [
otherKeysEnum nextObject]);) {
36 if (![
self objectForKey:key])
40 id thisObject = [
self objectForKey:key];
43 if ([thisObject isKindOfClass:[NSDictionary
class]] && [otherObject isKindOfClass:[NSDictionary
class]] && (![thisObject isEqual:otherObject])) {
44 NSMutableDictionary* mergeObject = [
NSMutableDictionary dictionaryWithDictionary:(NSDictionary*)thisObject];
45 [
mergeObject mergeEntriesFromDictionary:(NSDictionary*)otherObject];
46 [
self setObject:mergeObject forKey:key];
50 if ([thisObject isKindOfClass:[NSArray
class]] && [otherObject isKindOfClass:[NSArray
class]] && (![thisObject isEqual:otherObject])) {
51 NSMutableArray* mergeObject = [
NSMutableArray arrayWithArray:(NSArray*)thisObject];
52 [
mergeObject addObjectsFromArray:(NSArray*)otherObject];
53 [
self setObject:mergeObject forKey:key];
58 [
self setObject:otherObject forKey:key];