• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Restore Application With last open document
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Restore Application With last open document


  • Subject: Re: Restore Application With last open document
  • From: John Randolph <email@hidden>
  • Date: Tue, 27 Apr 2004 14:55:45 -0700

On Apr 27, 2004, at 6:30 AM, Cornelius Jaeger wrote:

Hi list,

i'm new here and to cocoa, so here goes:

when i start (restart) my document based app, is there an easy way to tell it to open the last saved document, or the document that was open last.
to clarify, i'm writing a display client, and if the machine needs to be restarted remotely the app needs to restart (no worries there using a systemStartupItem).
so i'd like it to open the document that was saved last automatically, or, open all the documents that where open, when the app shut down.

is there a way to do this?

Sure. You can just store the path to the document in question in the user defaults database. Check the docs for NSUserDefaults.

-jcr

John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Restore Application With last open document (From: Cornelius Jaeger <email@hidden>)

  • Prev by Date: Re: release not done right away
  • Next by Date: Re: xCode 1.2
  • Previous by thread: Restore Application With last open document
  • Next by thread: Re: Restore Application With last open document
  • Index(es):
    • Date
    • Thread