My program keeps crashing:
-(void) moveImage:(UIImageView *)image duration:(NSTimeInterval)duration curve:(int)curve x:(CGFloat)x y:(CGFloat)y key:(NSString *)key
{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:duration];
[UIView setAnimationCurve:curve];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationDidStopSelector:@selector(animationDidStop:)];
CGAffineTransform transform = CGAffineTransformMakeTranslation(x, y);
image.transform = transform;
[UIView commitAnimations];
}
This gets called, and when finished i want it to call the method bellow:
-(void)animationDidStop:(NSString *)key
{
if (key == @"burn") {
//The burn card has been moved and stopped. Ready for the next.
[self annPlayerRight];
}
}
What am i doing wrong?