0
嗨,我使用以下代碼從NSMutableDictionary中刪除對象,這兩個字典都包含相同的數組值,如果我從D1中刪除一個值,則會從D2中自動刪除相同的值。 幫我如何解決這個問題,NSMutableDictionary從不同的數組中刪除相同的值
NSMutableDictionary *D1=[[NSMutableDictionary alloc]init];
NSMutableDictionary *D2=[[NSMutableDictionary alloc]init];
NSMutableArray *arr_objs = [[NSMutableArray alloc]initWithObjects:@"ss",@"nn", nil];
[D1 setObject:arr_objs forKey:@"Keys"];
[D2 setObject:arr_objs forKey:@"Keys"];
[[D1 objectForKey:@"Keys"]removeObject:@"nn"];
'[[D1 objectForKey:@「Keys」] removeObject:@「nn」]; D2 = [D1 mutableCopy];' – 2015-04-06 07:23:59