you're welcome
When releasing, it should be enough to release the array. (any loop is not necessary)
Actually it depends on how you put your objects in the array.
for example.
//somewhere inside interface:
@property (retain) NSArray *arr;
.
.
.
//inside implementation:
UIImageView *img1 = [[UIImageView alloc] init];
//the retain count should be 1,
//then create an array an set your array property
NSMutableArray *_arr = [[NSMutableArray alloc] init];
self.arr = _arr;
[_arr release];
[arr addObject:img1];
//then the retain count of img1 should be 2
[img1 release];
//img1 retain count became 1 again.
//and in your dealloc method:
[arr release];
[super dealloc];
//img1 and arr's retain count should be 0 then everything goes just fine (No leaks)
A good rule is that you release properties inside dealloc method. And not all the variables you used somewhere else. (because they will be out of scope
and should have been released before )
Maybe this example was not clear enough...
Try reading some Memory management stuff... I remember I learned a lot from Kochan's book, Programming in Objective-C.