我有两个 NSArray:
NSArray *wants = [NSArray arrayWithObjects:
@"apples",
@"oranges",
@"pineapple",
@"mango",
@"strawberries",
nil];
NSArray *needs = [NSArray arrayWithObjects:
@"apples",
@"pineapple",
@"strawberries",
nil];
我想要XOR
他们。像wants - needs
这样的东西,我剩下的就是
[NSArray arrayWithObjects:
@"oranges",
@"mango",
nil];
我通常会经历一些繁重的循环,但我相信有一种更实用的方法。我应该怎么做?