My array:
NSMutableArray *squareLocations;
CGPoint dotOne = CGPointMake(1, 1);
[squareLocations addObject:[NSValue valueWithCGPoint:dotOne]];
CGPoint dotTwo = CGPointMake(10, 10);
[squareLocations addObject:[NSValue valueWithCGPoint:dotTwo]];
CGPoint dotThree = CGPointMake(100, 100);
[squareLocations addObject:[NSValue valueWithCGPoint:dotThree]];
int num = [squareLocations count];
for (int i = 0; i < num; i++)
{
NSValue *pointLocation = [squareLocations objectAtIndex:i];
NSLog(@"%@", pointLocation);
}
When I ask squareLoctions
for an object count, it returns zero? But just above asking for count I added three NSValue objects??? Anyone have any ideas?