addObjectsFromArray
- by derek.lo
I have a question about memory management when using the addObjectsFromArray method. Basically, I have 2 arrays defined in the appDelegate. I need these 2 arrays for the duration of my application's runtime. I therefore release them in my appDelegate's dealloc method.
When I go to use these two arrays in a class, I want one array to store the values from the other, so that the other can have it's contents removed, but still stick around for use.
Something like this:
[appDelegate.arrayTwo addObjectsFromArray:appDelegate.arrayOne];
[appDelegate.arrayOne removeAllObjects];
I'm getting the compiler error: EXC_BAD_ACCESS because of a pointer issue? retaining issue? Any help would be greatly appreciated!
Thanks