Replace an Array with an Array

Posted by Dane Man on Stack Overflow See other posts from Stack Overflow or by Dane Man
Published on 2010-06-14T22:43:55Z Indexed on 2010/06/14 23:02 UTC
Read the original article Hit count: 209

Filed under:
|
|
|
|

I have and NSMutableArray and I want to replace it with another, but if I try to do it like this...

firstArray = secondArray;

...then it seems to erase the entire firstArray and I get this error message..

Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFArray objectAtIndex:]: index (0) beyond bounds (0)'

...and the bounds should be (6) not (0).

Is there a correct way to replace the array?

PS: I already checked the secondArray and it functions fine.

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about cocoa