私はXcodeの8.2の午前と異なるNSMutableDictionariesの値を追加し、OSXないのiOS、Objective-Cのは同じキー
のように、私はいくつかの異なるNSMutableDictionariesを持っている:私は方法でそれらを結合する必要が
NSMutableDictionary* dict1 = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
[NSNumber numberWithInt:1],@"key1",
[NSNumber numberWithInt:14],@"key2",
nil];
NSMutableDictionary* dict2 = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
[NSNumber numberWithInt:9],@"key1",
[NSNumber numberWithInt:1],@"key2",
[NSNumber numberWithInt:99],@"key3",
nil];
// and many more
私たちは(結果に対するunmutableまたは)新しいNSMutableDictionaryを取得して、一致するキーの値は、上記の例については、このように追加されていること:ここでは
NSMutableDictionary* result = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
[NSNumber numberWithInt:10],@"key1", // 9+1
[NSNumber numberWithInt:15],@"key2", // 14+1
[NSNumber numberWithInt:99],@"key3", // stays the same
nil];
あなたがこれまでに試みられてきましたか? – Shackleford
すべてのキーを繰り返して比較します。しかし、より効果的な何かがあるはずです –