Hello friends,
I am currently developing an application in iphone, i want to animate some images on screen and for the same i have written this code
for (int i = 1 ; i <= 5 ; i++)
{
imgview.image = [UIImage imageNamed: [NSString stringWithFormat:@"spleshScreen%d.png", 1]];
NSLog(@"i = %d" , i);
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:0.9];
[UIView setAnimationRepeatCount:5];
[UIView setAnimationBeginsFromCurrentState:YES];
imgview.image = [UIImage imageNamed: [NSString stringWithFormat:@"spleshScreen%d.png", i]];
i++;
imgview.frame = CGRectMake(imgview.frame.origin.x, (imgview.frame.origin.y + 180), imgview.frame.size.width, imgview.frame.size.height);
imgview.frame = CGRectMake(imgview.frame.origin.x, (imgview.frame.origin.y - 350), imgview.frame.size.width, imgview.frame.size.height);
[UIView commitAnimations];
}
if i remove the for loop code works fine, but with for loop it's not working neither it get any error
Please let me know what can be the problem