I currently have a three dimensional NSMutableArray which I need to deep copy. However, it appears that the following code causes it and its contents to become immutable, since it causes NSInvalidArgumentException when I attempt to remove any objects from it.
NSMutableArray* copy = [[[NSMutableArray alloc] initWithArray:input copyItems:YES] autorelease];
How can I deep copy an array without causing it to become immutable?
From the listing,
above from http://lists.apple.com/archives/cocoa-dev/2008/May/msg00172.html
So make sure before you add your
inputarray, convert that input array into a mutable copy and then call the method.Code: