I have several animations which, when triggered, have varying lengths of (unintentional) delays before they execute.
Inside viewDidLoad
i have something like:
NSString *fileName;
myArray = [[NSMutableArray alloc] init];
for(int i = 1; i < 285; i++) {
fileName = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"HD1.2 png sequence/HD1.2_%d", i] ofType:@"png"];
UIImage *image = [UIImage imageWithContentsOfFIle:fileName];
[humptyArray addObject:image];
//NSLog(@"Added object number %d: %@", i,regularImage);
}
falling.userInteractionEnabled = NO;
falling.animationImages = humptyArray;
falling.animationDuration = 6.3f;
falling.animationRepeatCount = 1;
I put in the NSLog
so i could confirm that the array is populated with the images, which it is. When i want to trigger the animation i call [falling startAniamting]
. Although the array has been preloaded with images there is still a delay between me triggering the animation and the animation executing.
What can i do so that there is no delay when i trigger the animation?