Re: NSDocument last document loading
Re: NSDocument last document loading
- Subject: Re: NSDocument last document loading
- From: Kyle Sluder <email@hidden>
- Date: Mon, 02 Jul 2012 14:13:51 -0700
On Jul 2, 2012, at 2:11 PM, Kyle Sluder wrote:
> On Jul 2, 2012, at 12:52 PM, Lee Ann Rucker wrote:
>
>> Subclass [NSWindow restorationClass] and return nil should work.
>
> Rather than subclassing every NSWindow in your app, you could instead add an override of +restoreWindowWithIdentifier:state:completionHandler: to the subclass of NSDocumentController you likely already have. Or you could just call -setRestorationClass: in your document's window controller's -windowDidLoad (or your document's -windowControllerDidLoadNib method if your app is so simple that you don't even have one of those).
Oops, I should've said "call -setRestorable:", not -setRestorationClass:. Going with -setRestorable: is the most direct way to define your explicit intent.
But the real answer to Todd's question is itself a question: if it takes 10 minutes to load a document, can you implement +canConcurrentlyReadDocumentsOfType: so the loading happens on a background thread?
--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