编辑:
我有两个不同的数组与一些重复的字符串,我想创建一个只有唯一字符串的新数组.
例如,取这两个数组:
NSArray *array1 = [[NSArray alloc] initWithObjects:@"a",@"b",@"c",nil];
NSArray *array2 = [[NSArray alloc] initWithObjects:@"a",@"d",@"c",nil];
// Result should be an array with objects "b", and "d"
// since they are the only two that are not repeated in the other array.
Run Code Online (Sandbox Code Playgroud)