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

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

  1. oceandrive
    Expand Collapse
    macrumors newbie

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

    CaseStudy:

    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
    Expand Collapse
    Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    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
    Expand Collapse
    macrumors regular

    Joined:
    Mar 24, 2008
    #3
    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
    Expand Collapse
    thread starter macrumors newbie

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

Share This Page