• 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
Prevent autoloading of last opened document
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Prevent autoloading of last opened document


  • Subject: Prevent autoloading of last opened document
  • From: Eric Gorr <email@hidden>
  • Date: Thu, 13 Feb 2014 16:12:27 -0500

What I want to do seems like it should be fairly straightforward, but doesn't seem to be. All I want to do is with a standard NSDocument Based (with Core Data) is prevent the last document opened from opening automatically the next time the application is launched.

What is the best way to accomplished this?

It seemed as if it might be as simple as overriding reopenDocumentForURL and having it do nothing, but that only seems to break creating new documents or opening the document normally.

I could probably disable all of the window restoration functionality and handle it all myself by using:

[window setRestorationClass:Nil];
[window setRestorable:NO];
[window invalidateRestorableState];

but this seems to be overkill and not really what I want to do as when I open the document via File->Open, I want it to restore without the need for me to handle it myself.

Is there some easy way to make this work?

The deployment target is 10.7.

I have a sample test project at:

	https://github.com/ericgorr/autoload.git

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Prevent autoloading of last opened document
      • From: Mike Abdullah <email@hidden>
  • Prev by Date: Re: How do I animate Core Graphics drawing?
  • Next by Date: Re: -[NSPersistentStoreCoordinator metadataForPersistentStoreOfType:URL:error:] foibles
  • Previous by thread: Cocoaheads Lake Forest (92630) meets tonight, under new management
  • Next by thread: Re: Prevent autoloading of last opened document
  • Index(es):
    • Date
    • Thread