Does the memory increase every time the loop fires, or only when creating new TestViews?
Where do you declare the array MyImage[] ? I think you're walking all over memory that you did not allocate. That's a very big deal.
Also, [MyImage[50] release] does not release all of the images - it only releases the one at index 50. That's one problem, if you're repeatedly creating and removing "TestView" objects. Better to release each imageView right after you add it as a subview.
You could also replace your "switch" statement with "NextImage = counter" , but that's not a memory problem.
__________________

Free Games!
|