Sorry I didn't understand your question properly before. Maybe you could try something like:
NSMutableArray *points1 = [NSMutableArray arrayWithObjects:
[NSValue valueWithCGPoint:CGPointMake(1, 1)],
[NSValue valueWithCGPoint:CGPointMake(1, 1)],
[NSValue valueWithCGPoint:CGPointMake(1, 2)],
[NSValue valueWithCGPoint:CGPointMake(1, 3)], nil];
NSArray *points2 = [NSArray arrayWithObject:
[NSValue valueWithCGPoint:CGPointMake(1, 1)]];
NSInteger index = NSNotFound;
for (NSValue *point in points2) {
index = [points1 indexOfObject:point];
if (NSNotFound != index) {
[points1 removeObjectAtIndex:index];
}
}
NSLog(@"%@", points1);
=> 2012-03-04 00:02:26.376 foobar[19053:f803] (
"NSPoint: {1, 1}",
"NSPoint: {1, 2}",
"NSPoint: {1, 3}"
)
Update
NSNotFound is defined in NSObjCRuntime.h. You can find this out by command + clicking on the symbol NSNotFound in Xcode.
The definition is
enum {NSNotFound = NSIntegerMax};
The reason I knew to use this is by looking at the NSArray documentation for the indexOfObject: method, which reads:
Return Value
The lowest index whose corresponding array value is equal to anObject. If none of the objects in the array is equal to anObject, returns NSNotFound.