I'm trying to get a square to appear at one of the points in an array of points. I'm using 'Square.center = array[random integer]' to pick the point.
I get the error "Assigning to 'CGPoint' (aka 'struct CGPoint') from incompatible type 'id'". I think this means it can't find a point in my array.
I have my array set up like so, cobbled together from various examples I've found.
Array = [NSArray arrayWithObjects:
[NSValue valueWithCGPoint:CGPointMake(
self.canvas.center.x,
self.canvas.center.y
)],
[NSValue valueWithCGPoint:CGPointMake(
self.canvas.center.x+55,
self.canvas.center.y
)],
[NSValue valueWithCGPoint:CGPointMake(
self.canvas.center.x-55,
self.canvas.center.y
)],
[NSValue valueWithCGPoint:CGPointMake(
self.canvas.center.x,
self.canvas.center.y+55
)],
[NSValue valueWithCGPoint:CGPointMake(
self.canvas.center.x-55,
self.canvas.center.y
)],
nil
];
How can I get my square onto one of those points? Later I want to have a the same square on every point.