self.arr=[NSMutableArray new];
self.dic=[NSMutableDictionary new];
[self.arr addObjectsFromArray:@[@"1",@"2",@"3"]];
[self.dic setObject:self.arr forKey:@"key1"];
[self.arr removeAllObjects];
[self.arr addObjectsFromArray:@[@"3",@"4",@"5"]];
[self.dic setObject:self.arr forKey:@"key2"];
NSLog(@"%@",self.dic);
输出结果:
{
key1 = (
3,
4,
5
);
key2 = (
3,
4,
5
);
}