Re: Restore Application With last open document
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.