nsset有序,但是可以打印出相同的元素,厉害

NSMutableSet *set = [NSMutableSet new];

[set addObject:@[@1,@2]];

NSMutableArray *arrayC = [@[@1] mutableCopy]; [

set addObject:arrayC];

NSLog(@"set=%@",set);

 

 

[arrayC addObject:@2];

NSLog(@"set=%@",set);

 

NSMutableSet *setB = [set copy];

NSLog(@"setB=%@",set);

 

打印

2018-03-02 11:16:15.810777+0800 test[4534:321047] set={( ( 1 ), ( 1, 2 ) )}

2018-03-02 11:16:15.811008+0800 test[4534:321047] set={( ( 1, 2 ), ( 1, 2 ) )}

2018-03-02 11:16:15.811185+0800 test[4534:321047] setB={( ( 1, 2 ) )}

posted @ 2018-03-02 11:18  巅峰之斗  阅读(295)  评论(0编辑  收藏  举报