Skip navigation.
 
mlNSDocument or NSXMLDocument?
FROM : Charles Ross
DATE : Sun Apr 24 00:01:48 2005

I have an application I want to build for myself. I'm more of an 
AppleScript person, but I'm taking advantage of this application to 
learn to program Cocoa with Objective-C. I'm very much a newbie with 
Objective-C, but I'm hoping that my application is simple enough for 
me to figure out things as I go.

Basically, the application is a journal. For a while, I've kept this 
in BBEdit as an XML file with a DTD that I designed. I want to write 
a GUI for this so that I don't have to keep entering the tags. I want 
to keep the format of the file as XML so that if I wish, I can edit 
it with BBEdit.

When I create a document based Cocoa project, the template creates 
the MyDocument.h file, which defines the MyDocument class as 
inheriting from the NSDocument class. From what I understand, this 
gives me a lot of functionality for creating a new document. However, 
the NSXMLDocument class is going to give me most of what I need for 
dealing with the XML format. Right now, I'll only be working with one 
document, so the ability to open multiple documents isn't an issue 
yet, but in the future I'd like to be able to add the ability to have 
multiple XML documents open.

So I'm looking for advice on how to proceed. Should make the primary 
class an NSDocument or an NSXMLDocument? Making it an NSDocument will 
give me the flexibility of easily incorporating multiple documents in 
the future, but NSXMLDocument is going to give me the tools to work 
with the format I've chosen, but NSXML doesn't inherit anything from 
NSDocument, so by using it, I lose all of the NSDocument flexibility.

If I can provide any more information that would help with giving 
advice here, please let me know.

Thanks,
Chuck

Related mailsAuthorDate
mlNSDocument or NSXMLDocument? Charles Ross Apr 24, 00:01
mlRe: NSDocument or NSXMLDocument? Matt Neuburg Apr 24, 19:09