Change UIImageView Center - iPhone
- by CccTrash
I am trying to make a little ball that rolls around based on the accelerometer values in the iPhone.
This code will not build:
-(void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration
{
if(difficulty == @"easy")
{
CGFloat newX = (CGFloat)(ball.center.x + (CGFloat)acceleration.x);
CGFloat newY = (CGFloat)(ball.center.y + (CGFloat)acceleration.y);
ball.center.x = newX;
ball.center.y = newY;
}
}
It gives me an lvalue required as left operand of assignment error.
I've tried 100 different things and I fail every time...This is just the latest failure.
Anyone have any insight?