Re: Opening a file but not associating with NSDocument
Re: Opening a file but not associating with NSDocument
- Subject: Re: Opening a file but not associating with NSDocument
- From: Jerry Krinock <email@hidden>
- Date: Fri, 20 May 2016 06:48:15 -0700
> On 2016 May 19, at 23:40, Rick Mann <email@hidden> wrote:
>
> By "Reader," do you mean "Viewer?" I see no "Reader" option.
Yes, I remembered the wrong word. English is so redundant. :)
> Also, what do you mean "have no windows?" I just don't create anything in -makeWindowControllers?
Correct.
> I'm currently doing this. I have the two document types as you described, but both point to the same NSDocument subclass. In readFromFileWrapper(), if it's the .mfst type, I read the data in that I can, and then:
>
> self.fileURL = nil
> self.updateChangeCount(.ChangeReadOtherContents)
>
> So far, this does what I would expect (creates a new document with info from the .mfst file, but if I close it, it prompts to Save As).
I’m not sure what you mean by “close it”. But, no matter, I would have used two different NSDocument subclasses. Maybe that would prevent this. Cocoa should then know that you can’t save the .mfst document class, because you’re only a “Viewer”.
> I have yet to write my saving code, so I don't know if this works.
Cocoa should handle that in the usual way.
_______________________________________________
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