Q:

How to IntersectSet of two NSDictionary or NSMutableDictionary with values?

Want to merge two NSDictionary or NSMutableDictionary only with dict1 values. like [NSMutableDictionary addEntriesFromDictionary:] and intersectSet (from NSMutableSet).
 Dict 1 = @{@”One”: @””, @”Two”: @”"}

 Dict 2 = @{@”One”: @”1”, @”Two”: 2, @”Three”: @”3"}

My expect output after merge = @{@”One”: @”1”, @”Two”: @”2"}
UPDATE
I am already tried with [Dict1 addEntriesFromDictionary:Dict2] this one give answer @{@”One”: @”1”, @”Two”: 2, @”Three”: @”3"}
Also I am tried with NSMutableSet
NSMutableSet *keysInA = [NSMutableSet setWithArray:tempDict.allKeys];
NSSet *keysInB = [NSSet setWithArray:tempDict1.allKeys];
[keysInA intersectSet:keysInB];
NSLog(@"keys in A that are not in B: %@", keysInA);

This one give output One, Two, Three.
So [NSMutableSet setWithArray:] and [NSMutableDictionary addEntriesFromDictionary:] won't give what I expected.
If above code have anything work let clear me. Thanks.

A:

NSDictionary *dict1 = @{@"One": @"", @"Two": @"6"};

NSDictionary *dict2 = @{@"One": @"1", @"Two": @"2", @"Three": @"3"};

NSDictionary * dict = [dict2 dictionaryWithValuesForKeys:[dict1 allKeys]];

NSLog(@"dict %@",dict);

// Log value
dict {
One = 1;
Two = 2;
}

Here what I expected.

