How to start my application from last exit point, if any.

Discussion in 'iOS Programming' started by oceandrive, Nov 17, 2008.

  1. oceandrive macrumors newbie

    Nov 17, 2008
    New to icoding. Can someone please guide me how to start my application from where I had exited earlier.


    1) I opened my sample application
    2) Entered some comments into the textarea.
    3) Exit the application

    4) Not if I open my applicaiton I want to see the data which I entered previously.

    Thanks for help.
  2. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    You'll want to save your data (using NSUserDefaults is pretty easy) in the applicationWillTerminate: method of your application delegate and then restore it in the applicationDidFinishLaunching: method of the same.
  3. fenrus110 macrumors regular

    Mar 24, 2008
    check out the DrillDownSave sample.

    Though, the TextView might be a bit trickier. I'd recommending looking for any events that execute just before the app closes and then save into NSUserDefaults or sqlite
  4. oceandrive thread starter macrumors newbie

    Nov 17, 2008
    Thanks for the excellent help. I followed the example and it worked like what I wanted. Keep up the good work.

Share This Page