Change UIImageView Center - iPhone

Posted by CccTrash on Stack Overflow See other posts from Stack Overflow or by CccTrash
Published on 2010-06-10T16:09:18Z Indexed on 2010/06/10 16:13 UTC
Read the original article Hit count: 871

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk