My code for my images is
-(IBAction)start:(id)sender
{
animation.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"Paddle 1.png"],
[UIImage imageNamed:@"Paddle 2.png"],
[UIImage imageNamed:@"Paddle 3.png"],
[UIImage imageNamed:@"Paddle 4.png"],
nil];
[animation setAnimationRepeatCount:0];
animation.animationDuration = 2.5;
[animation startAnimating];
}
This is caching too much memory and I was told in a previous question to swap my code to using
[UIImage imageWithContentsOfFile: GetImgWithoutCaching(@"Paddle 1.jpg")]
and
UIImage* GetImgWithoutCaching(NSString* imgName)
{
NSString *imagePath = [[NSBundle mainBundle] pathForResource:imgName ofType:nil];
return [UIImage imageWithContentsOfFile:imagePath];
}
What is the correct way of writing the code? do i place that code in my .m as is?