• 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: Auto-saving documents
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Auto-saving documents


  • Subject: Re: Auto-saving documents
  • From: Chris Idou <email@hidden>
  • Date: Sun, 1 Feb 2009 21:24:58 -0800 (PST)



On Sun, Feb 1, 2009 at 6:52 PM, Chris Idou <email@hidden> wrote:
>> I want my app to automatically save a document when the user closes its window, without prompting the user.
>
>What do you want to do if the user hasn't saved the document?  Do you
>want to prompt the user, save to a default location, or abandon the
>document?


I want the app to automatically save the document when the user closes the window. The way it works there is always a location to save.

>> I had thought I'd found a solution by overriding
>> - (void)canCloseDocumentWithDelegate:(id)delegate shouldCloseSelector:(SEL)shouldCloseSelector contextInfo:(void*)contextInfo
>> to call saveDocument: in the NSDocument. But apparently saveDocument can call canCloseDocumentWithDelegate: resulting in an endless loop.
>
>What makes you think that?

It looked like that in the debugger when it blew up with an endless stack frames in canCloseDocumentWithDelegate, and the active line seemed to be saveDocument. The only two lines were  saveDocument and [super canCloseDocumentWithDelegate...].



      Make Yahoo!7 your homepage and win a trip to the Quiksilver Pro. Find out more
_______________________________________________

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

References: 
 >Auto-saving documents (From: Chris Idou <email@hidden>)
 >Re: Auto-saving documents (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Can we render QCRenderer in CAOpenGLLayer..?
  • Next by Date: QCRenderer method createSnapshotImageOfType: returning nil
  • Previous by thread: Re: Auto-saving documents
  • Next by thread: Re: Can we render QCRenderer in CAOpenGLLayer..?
  • Index(es):
    • Date
    • Thread