Re: Can I use the restore/auto-save loading functions for imports?
Re: Can I use the restore/auto-save loading functions for imports?
- Subject: Re: Can I use the restore/auto-save loading functions for imports?
- From: Quincey Morris <email@hidden>
- Date: Mon, 06 Mar 2017 14:29:51 -0800
On Mar 6, 2017, at 13:58 , Daryle Walker <email@hidden> wrote:
>
> The docs fo “NSDocumentController.reopenDocument(for: withContentsOf: display: completionHandler:)” mention it’s for app restore.
> Do I have to restrict these methods for their documented purposes?
I think you do have to be careful, in the situation where the underlying document already has state information that this method might try to restore. Depending on when and where you invoke it yourself, and what you do next, you may trip over some oddities.
FWIW, I think the reason that no one has been jumping in to answer your questions about NSDocument is that the documentation architecture is now so old and so intricate that no one carries around the answers to subtle questions in their head any more. I know for certain that I don’t, at least. For anything but the most basic NSDocument subclassing needs, it’s usually necessary to experiment to find out how to do the unusual things, so you’re kind of on your own journey here.
I’m not sure you’ve mentioned consulting this reference document:
https://developer.apple.com/library/content/documentation/DataManagement/Conceptual/DocBasedAppProgrammingGuideForOSX/Introduction/Introduction.html <https://developer.apple.com/library/content/documentation/DataManagement/Conceptual/DocBasedAppProgrammingGuideForOSX/Introduction/Introduction.html>
It should still be correct, though it was last updated in 2012. Unfortunately, you sometimes have to read every word very closely to get answers to the harder questions, plus all of the additional documentation in the comments of the header files for NSDocument and NSDocumentController, along with the header files for related protocols such as state restoration, for the last 5 years of functional additions.
_______________________________________________
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