views:

85

answers:

1

I am copying a mutable array like this:

//copy players' info into playerList from a dictionary
playerList = [[NSMutableArray alloc] initWithArray:[params objectForKey:@"p"] copyItems:YES];

The items in the array implement copyWithZone like this:

- (id)copyWithZone:(NSZone *)zone
{
   PlayerInfo* copy = [[[self class] allocWithZone:zone] init];
   [copy setNick:[self nick]];
   ...
   [copy setIsChallengedByMe:[self isChallengedByMe]];

   return copy;
}

However, playerList only seems to have objects which are "out of scope". What am I doing wrong?

+1  A: 

I assume you mean they appear "out of scope" in the debugger. Don't worry about that, it is quite common and doesn't necessarily mean something is wrong. If you print the description of the array to the console, it should print everything fine.

JeremyP