NSArray *mutableArray = [NSArray arrayWithObjects:@"123",@"ff",@"xx",@"123",@"xx",nil];
NSArray *resultArray = [mutableArray valueForKeyPath:@"@distinctUnionOfObjects.self"];
NSLog(@"%@",mutableArray);
NSLog(@"%@",resultArray);
2016-03-17 09:00:15.883 WhiteDragon[906:16675]
(
"123"
"ff"
"xx"
"123"
"xx"
)
2016-03-17 09:00:15.884 WhiteDragon[906:16675]
(
"xx"
"123"
"ff"
)
网友评论