views:

38

answers:

2

how can i save the data in from texfield when i navigate back to previous view?

i have set the app to save all data to plist when terminate but i when i am navigating up and down view, i need to save the data to some place. any suggestion? save data when "back" button at nav bar is press? but how? save to NSUserDefaults?

A: 

Have you tried to use session variables? You can store all the fields in session vars and everytime a user visits that page, it will first check to see if the session vars are set. If so, render the form with those input fields pre-populated with the session var values. If not, then render a blank form.

Dylan West
I think you read this as a server-side web coding question, rather than an iPhone app question...
Seamus Campbell
any other ideas.....?
Stefan
A: 

You may consider storing the contents of the text field to an NSString * instance variable of your application delegate. The best place to do so would be viewDidUnload method, provided that you did retain the text field.

MrMage