I’m quite confused. I’m using the animation frames to make the objects move. Here’s the code:
campFireView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 80, 63)];
campFireView.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"campFire01.png"],
[UIImage imageNamed:@"campFire02.png"],
[UIImage imageNamed:@"campFire03.png"],
[UIImage imageNamed:@"campFire04.png"],
[UIImage imageNamed:@"campFire05.png"],
[UIImage imageNamed:@"campFire06.png"],
[UIImage imageNamed:@"campFire07.png"],
[UIImage imageNamed:@"campFire08.png"],
[UIImage imageNamed:@"campFire09.png"],
[UIImage imageNamed:@"campFire10.png"],
[UIImage imageNamed:@"campFire11.png"],
[UIImage imageNamed:@"campFire12.png"],
[UIImage imageNamed:@"campFire13.png"],
[UIImage imageNamed:@"campFire14.png"],
[UIImage imageNamed:@"campFire15.png"],
[UIImage imageNamed:@"campFire16.png"],
[UIImage imageNamed:@"campFire17.png"], nil];
campFireView.animationDuration =2.5;
campFireView.animationRepeatCount = 0;
[campFireView startAnimating];
[bgview addSubview:campFireView];
[campFireView release];
Please tell me how to release such kind of NSArray? I’ve not used any alloc in the code, so how to release this array as it is causing a lot of leak in my code.
You don’t. Your leak is most likely caused elsewhere in your code because what I see here should not leak by itself.