Let's say I have three mutablearrays: arr1, arr2 and arr3. I want to compare all the element in arr1 to each element in arr2, and if an element in arr2 contains all the elements in arr1, i want to add it to arr3. So i'm thinking it would look something like my code below. Is there some smart function in objective-c i don't know about, or any way this could be done?
for(int i; i < arr2.count; i++)
{
if([arr2 objectAtIndex:i] containAllElementsInArray:arr1]])
{
[arr3 addObject:[arr2 objectAtIndex:i]];
}
}
arr1anywhere in your code. Still trying to figure out if you want an intersection or another behaviour (ie: "if an element inarr2contains all the elements inarr1")