Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Mac Me Up

macrumors regular
Original poster
Jun 25, 2005
170
0
Australia
Supposing I have 3 views:
top
middle
end
Set up with a navigation controller eg:
top -> middle -> end
in top:
Code:
[[self navigationController] pushViewController:middle animated:YES];
in middle:
Code:
[[self navigationController] pushViewController:end animated:YES];
and to move back up
Code:
[[self navigationController] popViewControllerAnimated:YES];

So this structure works just fine to drill up and down my views. My problem is that if I am at my last view, and I simulate a memory warning, and then drill back down to the middle view, my middle view has been reset (eg: all the controls are back to the defaults, not to how the user might have changed them).

Is there a piece of the puzzle I'm missing here? The documentation seems to say that my view will only be released if it's not part of the view hiearchy. Do I have to do more than just a push to get it into the view hiearchy?
 

DipDog3

macrumors 65816
Sep 20, 2002
1,193
814
Supposing I have 3 views:
top
middle
end
Set up with a navigation controller eg:
top -> middle -> end
in top:
Code:
[[self navigationController] pushViewController:middle animated:YES];
in middle:
Code:
[[self navigationController] pushViewController:end animated:YES];
and to move back up
Code:
[[self navigationController] popViewControllerAnimated:YES];

So this structure works just fine to drill up and down my views. My problem is that if I am at my last view, and I simulate a memory warning, and then drill back down to the middle view, my middle view has been reset (eg: all the controls are back to the defaults, not to how the user might have changed them).

Is there a piece of the puzzle I'm missing here? The documentation seems to say that my view will only be released if it's not part of the view hiearchy. Do I have to do more than just a push to get it into the view hiearchy?

Are you releasing it? Can you just save the view info and reload when shown.
 

Mac Me Up

macrumors regular
Original poster
Jun 25, 2005
170
0
Australia
I'm not explicitly releasing it no, but when the memory warning is issued it gets released. I guess I could save the object that populates that view and re-populate it every time it loads...is that normal behaviour then?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.