~~~
NSArray *array = @[@{@"name" : @"xiaoming",
@"code" : @1},
@{@"name": @"judy",
@"code" : @2},
@{@"name": @"judy",
@"code" : @3},
@{@"name": @"xiaohua",
@"code" : @4}];
NSArray *newArr = [array valueForKeyPath:@"@distinctUnionOfObjects.name"];
NSLog(@"newArr = %@",newArr);
~~~