【发布时间】:2010-06-10 16:09:18
【问题描述】:
我正在尝试根据 iPhone 中的加速度计值制作一个滚动的小球。
此代码不会构建:
-(void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration
{
if(difficulty == @"Easy")
{
CGFloat newX = (CGFloat)(ball.frame.origin.x + (CGFloat)acceleration.x);
CGFloat newY = (CGFloat)(ball.frame.origin.y + (CGFloat)acceleration.y);
ball.frame.origin.x = newX;
ball.frame.origin.y = newY;
}
}
它给了我一个左值作为赋值错误的左操作数。
我尝试了 100 种不同的方法,但每次都失败了……这只是最近的失败。
有人有什么见解吗?
【问题讨论】:
标签: iphone uiimageview