Re: Times to not add a document to NSDocumentController?
Re: Times to not add a document to NSDocumentController?
- Subject: Re: Times to not add a document to NSDocumentController?
- From: John Joyce <email@hidden>
- Date: Tue, 27 Dec 2011 17:26:23 -0600
>
>> I'm working on a CAD app that has a library of parts that can be added to a document. Internally, I have a LibraryDoc to open library files, and present the library UI windows. But I don't really want it to behave like a "regular" document in my app.
>
> Can you be more specific please — in what way do you not want it to behave like a regular document?
>
Sounds like you already have a CAD document subclass of NSDocument, hmm?
And you want to leverage a separate but somehow related subclass of NSDocument for your library content and load the content.
So at the very simplest, if a library content document should be editable in the same application, you would simply make its internal structure the same or almost identical.
Give it a different UTI & extension.
Do different things with it when reading/writing to it. (checking for how, "edit mode" "library mode")
These are some guesses, but it's your thing to architect.
My guesses are based on the guess that you would be able to copy & paste between two of your CAD documents.
With that, it would seem to be best to make the library content basically the same, but with a minor difference in naming and requirement that it goes in some location, such as your app's ~/Library/Application Support/<your app> folder.
_______________________________________________
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