Quote:
Originally Posted by NeoNate
Hi Smasher,
Thanks for the response. Yeap the memory increases with every loop.
|
The net bytes, or the overall bytes? overall bytes is fine, net bytes (and a climbing blue graph at the top) is a problem.
Quote:
|
Do I need to release after every image? When does dealloc get called?
|
Dealloc is called by the system when the object's retainCount becomes zero. This should happen when you release the testView and you remove it from the superview.
If this view is only used once for the lifetime of your program then this probably isn't the issue, but you should release all of the images in the dealloc. You could use a loop.
MyImage declaration looks fine. I don't see the purpose of these lines, though:
Code:
@interface TestView()
@property (nonatomic, retain) UIImageView *MyImage;
@end
@dynamic MyImage;
You are not using MyImage as a property, and I doubt you're creating dynamic methods for it.
I really don't see anything in gameLoop that should cause a memory increase. If you sort the objectAlloc display by "Net #" , can you tell what kind of object is climbing up the chart?