0
votes

Yes, I know that my problem is not the unique, but I have analysed many source codes but nothing works well. I am creating an array of 100 images which will be used for UIImageView animation and after finishing animation I want to free the memory.

.h

IBOutlet UIImageView* 1mage;

.m

NSMutableArray* 1mageArray = [[NSMutableArray alloc]initWithCapacity:99];

for (int i=1; i<=100; i++) { [1mageArray addObject:[UIImage imageNamed:[NSString stringWithFormat:@"1mage_%.4d.png",i]]]; }

1mage.animationImages = 1mageArray;

1mage.animationDuration = 8.0;

1mage.animationRepeatCount = 0;

[1mage startAnimating];

[1mageArray release];

I have read Memory Management Guide, and seems, like I am doing everything okay, but debugger does not agree with me, and after playing the animation I still have 60 MB used.

Thanks in advance!

copy/paste , and I shorted variables by replacing the long text with 1. do not pay attention on this!

1
1 == I ? how could that happen with copy and paste?! - Eiko
If that is copied and pasted, it wouldn't even compile. You cannot begin a variable name with a number. - Evan Mulawski

1 Answers

0
votes

Your image will retain the data when you you set the animationImages. After all, it needs those images, doesn't it?

If you release it or set its animationImages property to nil, they might be released...