【发布时间】:2010-11-21 03:23:53
【问题描述】:
大家好...今天是我第一天破解 iphone SDK。有一个爆炸,但有一个快速的问题。
我正在尝试通过从滑块发送信息来动态地在屏幕上移动 UIView。我的滑块工作正常,但我似乎无法弄清楚如何让 UIView 移动。
我的 .h 文件...
@interface Slider_BallViewController : UIViewController
{
IBOutlet UISlider *theslider;
IBOutlet UITextField *ytext;
IBOutlet UIView *theball;
}
- (IBAction)moveVert:(id)sender;
我的 .m 文件...
- (IBAction)moveVert:(id)sender
{
int progressAsInt = (int)(theslider.value);
NSString *newText = [[NSString alloc] initWithFormat:@"%d", progressAsInt];
ytext.text = newText;
theball.frame.origin.y += progressAsInt;
}
我在我的 .m 文件中的 frame.origin 行收到一个错误,上面写着... lvalue required as left operand assignment。不知道我做错了什么。
任何帮助都很好,谢谢。
【问题讨论】:
标签: iphone cocoa-touch