O.K.
I have many CGPoints, all in viewDidLoad like this:
Code:
bRookStart = CGPointMake(372, 93);
bQueenStart = CGPointMake(372, 57);
And I want to be able to use these easily without a lot of if statements... So I looked online and tried lots of things, but nothing worked. The following is probably the closest I got, but my new piece turned up at 0,0 (this is incomplete code, only the important part. The rest all works fine).
The pieceToAdd is a string such as bRook or bQueen.
Code:
CGPoint newPoint = CGPointFromString([NSString stringWithFormat:@"%@Start", pieceToAdd]);
myNewPiece.center = newPoint;
any help would be greatly appreciated.