On Mar 24, 2014, at 10:05 AM, Colas B <colasj...@yahoo.fr> 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 (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com