Re: Multi document - design question
Re: Multi document - design question
- Subject: Re: Multi document - design question
- From: Joseph Heck <email@hidden>
- Date: Wed, 29 Oct 2003 08:33:25 -0800
On Oct 29, 2003, at 1:44 AM, Alex Penner wrote:
>
I want to create some kind of multi document application.
>
>
The main difference - all documents will be created and altered using
>
database as back-end and not file system. I would like to use Cocoa
>
multi document support, because of the all advantages.
>
>
What are the issues I have to pay attention to?
>
Are there any examples, how to subclass a NSDocumentController?
>
Are there any examples, that shows NSDocumentController subclass
>
working with "generic" documents?
>
>
Or would it be just simpler to write my own document manager?
Hi Alex,
Although I'm sure there's other tidbits to be dealt with, I'd expect
that just keeping careful track of where you would "normally" serialize
and deserialize your data to disk would be sufficient.
With the Cocoa Multi-Document framework, you actually get a fair number
of choices on how to do that. There's
- (NSData *)dataRepresentationOfType:(NSString *)aType
and
- (BOOL)loadDataRepresentation:(NSData *)data ofType:(NSString *)aType
You could do the sort of gross thing and slap the NSData into a blob,
or you could be neater about the whole operation and just use the
method as a holder for you to grab the data from your current
application state and shove into the respective corners you have set up
for it.
One of the (in my opinion) huge benefits of using the Cocoa
multi-document framework is that (if you set things up right - there's
demos) you get some wonderfully easy undo and redo support.
Vermont Recipes has some excellent examples on setting up Cocoa
Document based apps (he uses the methods listed above).
Hope this helps,
-joe
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.