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 04-23-2009, 04:58 PM   #8 (permalink)
ziconic
Registered Member
 
Join Date: Feb 2009
Posts: 64
ziconic is on a distinguished road
Default

Quote:
Originally Posted by brian515 View Post
I tried what you said, and if I release the view controller right after I have pushed it, but if I try to preform the task again, the program throws an exception.
When you initialize your viewcontroller, set it to autorelease before you push the viewcontroller.

That way, when you push the viewcontroller, it will be added to the viewcontroller stack and autorelease will decrement its retain count.

When you pop the viewcontroller later, its retain count will be decremented to 0, and dealloc will be called, freeing the memory previously allocated to the viewcontroller.

Dollop's method works too, but you need to somehow keep track of the viewcontroller between the push and the pop. Using autorelease is easier.
__________________
Storie
Download Storie now - it's free!
ziconic is offline   Reply With Quote
 

» Advertisements
» Online Users: 430
20 members and 410 guests
apatsufas, bdavid186, CatfishBlues Games, ChrisYates, desbrina, falco1973, gogoman, Lisafleu, LunarMoon, mer10, milanalina, PavelMik, Robemtims, sacha1996, solie, themartist, VinceYuan, Wikiboo, ziocleto, zzeze
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,621
Threads: 94,087
Posts: 402,801
Top Poster: BrianSlick (7,990)
Welcome to our newest member, solie
Powered by vBadvanced CMPS v3.1.0

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