OGeek|极客世界-中国程序员成长平台

标题: objective-c - 如何在 objective-c 中以编程方式设置图像位置? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 18:56
标题: objective-c - 如何在 objective-c 中以编程方式设置图像位置?

我想在 3 秒后将图像移动到另一个 x,y 坐标我尝试了这个但我收到了这样的错误:2012-01-17 14:01:11.417 YapiKrediDemo[2147:207] -[Sozlesme moveImage]:无法识别的选择器发送到实例 0x6e07540 我的代码是:

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.

image1=[[UIImageView alloc] initWithImage:[UIImage imageNamed"GirisButton.png"]];
[self.view addSubview:image1];

[NSTimer scheduledTimerWithTimeInterval: 3
                                 target: self
                               selectorselector(moveImage)
                               userInfo: nil repeats:YES];

}

- (void)moveImageNSTimer*)timer{

//[image1 setCenter: CGPointMake(634, 126)];
CGRect myFrame = image1.frame;
myFrame.origin.x = 634;
myFrame.origin.y = 126;
image1.frame = myFrame;
}

我该如何解决这个问题?请帮助我,谢谢。



Best Answer-推荐答案


你忘记了 : 符号

selectorselector(moveImage

关于objective-c - 如何在 objective-c 中以编程方式设置图像位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8894335/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4