• 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: Re : Re: Saving while opening with NSDocument
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re : Re: Saving while opening with NSDocument


  • Subject: Re: Re : Re: Saving while opening with NSDocument
  • From: Kyle Sluder <email@hidden>
  • Date: Mon, 24 Mar 2014 10:55:13 -0700

On Mar 24, 2014, at 10:05 AM, Colas B <email@hidden> wrote:
>
> Finally, I put the "saveDocument" in the "NIBDidLoad" method, with an "afterDelay:0". I was reluctant to use this "afterDelay:0" (I wish there were a method called "performOnNextRunLoop"). This smells like a hack !!!
> It was easier to call the "saveDocument" than to subclass NSDocumentController, and result is safer I think. I don't have to deal with the case where no nib is loaded.
>
> It works well.

Please heed my advice about not using -windowControllerDidLoadNib. Put it somewhere else. In addition to breaking if you ever decide to start overriding -makeWindowControllers (which in my experience all but the most trivial apps wind up doing), this can cause serious problems if the user ever chooses File > Revert.

The correct thing to do often appears harder than it should be because much of the difficulty of doing it the right way comes from not understanding the architecture.

--Kyle Sluder

_______________________________________________

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: 
 >Re: Saving while opening with NSDocument (From: Quincey Morris <email@hidden>)
 >Re : Re: Saving while opening with NSDocument (From: Colas B <email@hidden>)
 >Re: Re : Re: Saving while opening with NSDocument (From: Colas B <email@hidden>)

  • Prev by Date: Re: Re : Re: Saving while opening with NSDocument
  • Next by Date: Re: Simulating sublayers in CATiledLayer
  • Previous by thread: Re: Re : Re: Saving while opening with NSDocument
  • Next by thread: menuNeedsUpdate for key equivalents?
  • Index(es):
    • Date
    • Thread