Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 06-09-2009, 08:22 PM   #1 (permalink)
brian515
Registered Member
 
Join Date: Feb 2009
Posts: 109
brian515 is on a distinguished road
Default Yet Another Memory Management Question

Hi again,

I'm having yet another problem with memory management. I have a UIViewSubclass which I place on top of a view in a view controller. After being frustrated by the quartz drawings I make on the UIViewSubclass disappearing from the screen if I presented a modal view or pushed another view onto the nav controller stack, I realized that if I declare my view like so, it will remain even if I do one of the above actions.
Code:
if(draw == nil) {
      draw = [[[DrawingView alloc] initWithFrame:self.view.frame] retain];
}
I release "draw" in the dealloc of the view controller I put it "draw" on, and I can confirm that release command does get called.

However, the problem is that the dealloc of the "draw" view does not get called. Therefore, every time the "draw" instance is created (this could happen multiple times, depending on the user), another 2mb of ram vanishes.

Any suggestions would be much appreciated. Thanks in advance!
brian515 is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,636
Threads: 94,101
Posts: 402,813
Top Poster: BrianSlick (7,990)
Welcome to our newest member, samdanielblr
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:17 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.