[Solved] Compare 2 arrays of strings


Your code contains a lot of syntax errors.
Please post actual code, I understand the issue you are talking about, that’s why I’m posting this answer. Please post questions with valid code, else you won’t get proper answer (Only get downvotes)

Use the following code:

NSArray *current = @[@"1", @"6", @"53"];
NSArray *newArr  = @[@"1", @"626", @"53", @"13"];


NSMutableSet *newSet = [NSMutableSet setWithArray:newArr];
[newSet minusSet:[NSSet setWithArray:current]];
NSArray * result1 = [NSArray arrayWithObjects:[newSet allObjects],nil];
// result 1 will have 626 and 13

newSet = [NSMutableSet setWithArray:current];
[newSet minusSet:[NSSet setWithArray:newArr]];
NSArray * result2 = [NSArray arrayWithObjects:[newSet allObjects],nil];
// result 2 will have 6

solved Compare 2 arrays of strings