I want to move image to another x,y position. I try this code but not work it crash after 3 seconds. The error is: 2012-01-17 12:40:47.213 YapiKrediDemo[1986:207] -[Sozlesme moveImage:]: unrecognized selector sent to instance 0x6c316c0.
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
image1=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"GirisButton.png"]];
[NSTimer scheduledTimerWithTimeInterval: 3
target: self
selector:@selector(moveImage:)
userInfo: nil repeats:YES];
}
-(void) moveImage
{
//[image1 setCenter: CGPointMake(634, 126)];
CGPoint pointOne=CGPointMake(634, 126);
image1.center=pointOne;
}
How can I solve ?
The selector is
@selector(moveImage). No:at the end. Or you have to add a parameter to the moveImage method. That’s what you should do.- (void)moveImage:(NSTimer*)timer