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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 03-08-2010, 10:32 PM   #1 (permalink)
ELA
Registered Member
 
Join Date: Jan 2010
Posts: 4
Default Navigation Controller Stack

Hi,

I've got into a situation where I need expert help.

I'm trying to create an Flash Card Application, where user can swipe through group of image (audio + image) cards. I've used the Navigation Controller to manage the view controllers.

The problem, when the user pushes to the 10 or 11th view controller, my application reaches around 9 MB of memory. For example, if my navigation controller stack has the following view controllers in it;
- RootViewController
- ViewController1
- Viewcontroller2
- ViewController3
- Viewcontroller4
- ViewController5
- Viewcontroller6
- ViewController7
- TopViewController

If my navigation controller stack has 8 view controllers, excluding the root, I would like to nullify the view's (or some thing else, which would release the memory associated with that view controller) associated with the view controllers 1 - 5 (I still want to have these view controllers part of my navigation controller stack. Just want to release the view (which has an subview of UIImageView) associated with them.

Is there any way I can achieve that?

Also, when the user swipes back (navigating backwards, where I pop the top view controller) and reaches the above nullified view controllers, I want to reload the image and show it to the user.

I'm not sure whether I explained my requirement/issue properly. Please let me know if I didn't.

Thanks
Ela
ELA is offline   Reply With Quote
Old 03-09-2010, 02:11 AM   #2 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 1,015
Default

normally you would release the hidden views, but I don't think this is possible for views belonging to a navigation controller.

you can write for each of your view controllers a releaseContent function where you release all the subviews/images of the view, but not the view itself.
similarly you write an allocContent function for each view.
then you call the releaseContent function when another view gets pushed on top and call the allocContent function when the view reappears.
Tambourin is offline   Reply With Quote
Old 03-09-2010, 09:46 PM   #3 (permalink)
ELA
Registered Member
 
Join Date: Jan 2010
Posts: 4
Default

Thanks Tambourin. I would try that way and let you know the results.

Thanks
Ela

Quote:
Originally Posted by Tambourin View Post
normally you would release the hidden views, but I don't think this is possible for views belonging to a navigation controller.

you can write for each of your view controllers a releaseContent function where you release all the subviews/images of the view, but not the view itself.
similarly you write an allocContent function for each view.
then you call the releaseContent function when another view gets pushed on top and call the allocContent function when the view reappears.
ELA is offline   Reply With Quote
Reply

Bookmarks

Tags
navigation controller

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 266
17 members and 249 guests
@sandris, ADY, Alsahir, dacapo, Dani77, Desert Diva, djohnson, HemiMG, jansan, JasonR, MarkC, mer10, prchn4christ, ryandb2, smethorst, tomtom100
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,882
Threads: 89,228
Posts: 380,762
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jansan
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:58 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0