Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 19, 2009, 08:15 AM   #1
beardedpig
macrumors member
 
Join Date: Dec 2008
What happens to views in navigation controller

Does anyone know what happens to a viewcontroller that is moved to the left as a new view is pushed onto the stack?

For example if the viewcontroller is pushed onto the stack and whilst in display is modified. Then another view is pushed onto the stack and scrolls in from the right.

When this final view is popped off the stack resulting in the previous view coming back into view should this returning view still retain the modified state and not the state it was originally in when pushed on the stack?
beardedpig is offline   0 Reply With Quote
Old Jan 19, 2009, 09:11 AM   #2
PhoneyDeveloper
macrumors 68020
 
PhoneyDeveloper's Avatar
 
Join Date: Sep 2008
It depends.

In most cases the view controller that is hidden and then revealed doesn't change at all.

However, in the case of a memory warning a hidden view controller will have its view unloaded and then reloaded. After the view is reloaded the view controller will appear to have reverted to a previous state, unless things are coded specifically to work around this.

Also, when the view controller reappears its viewWillAppear and viewDidAppear methods are called. Depending on how they're written the view may be updated with new data. For example if you have a table that pushes a detail view that allows the user to edit something then when the detail view is popped the table should update itself with the new values.

Last edited by PhoneyDeveloper; Jan 20, 2009 at 09:26 AM.
PhoneyDeveloper is offline   0 Reply With Quote
Old Jan 19, 2009, 09:29 AM   #3
beardedpig
Thread Starter
macrumors member
 
Join Date: Dec 2008
HI, really appreciate your answer thanks and in digesting it I looked at this bit of code in my app:

Code:
-(void) viewWillAppear: (BOOL) animated
{	
	imageView.image = image;
	
	[super viewWillAppear: animated];
}
Now I am trying to find the book and section which said you should do this, but when I commented it out the app runs exactly as I want it to, i.e not reverting to the initialising image!
beardedpig is offline   0 Reply With Quote
Old Jan 19, 2009, 11:47 AM   #4
dejo
Demi-God (Moderator)
 
dejo's Avatar
 
Join Date: Sep 2004
Location: Colorado
Perhaps try moving the "imageView.image = image;" into viewDidLoad.
dejo is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
upgrading from Iphone 1st gen to iphone 4 what happens to data in apps? cep iPhone Tips, Help and Troubleshooting 3 Jun 27, 2010 05:42 PM
What happened to "reveal in Browser" in Final Cut Pro? Chulo Mac Applications and Mac App Store 1 Jan 23, 2008 05:53 PM
What happened to Leopard Quicktime preview controls in finder? mparkes Mac OS X 3 Nov 4, 2007 08:09 AM
What happened to gifts in iTunes 6? anthonymoody Mac Applications and Mac App Store 2 Nov 10, 2005 01:59 PM
what happened to apple in 2000? Oats Buying Tips, Advice and Discussion (archive) 2 Dec 16, 2003 02:27 PM


All times are GMT -5. The time now is 06:48 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Privacy / DMCA contact / Affiliate and FTC Disclosure
Copyright 2002-2013, MacRumors.com, LLC