Question

Is this valid:

 NSObject anObject = [[NSObject alloc] init];
 [array1 addObject:anObject];
 [array2 addObject:anObject];

My money is on yes, since I'm only adding references to the same object, or am I wrong here?

Was it helpful?

Solution

Yes :) Dont forget to make it a mutable array

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top