Can I add the same object to two different arrays?
-
08-10-2019 - |
문제
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?
해결책
Yes :) Dont forget to make it a mutable array
제휴하지 않습니다 StackOverflow