NSDocument or NSXMLDocument?
NSDocument or NSXMLDocument?
- Subject: NSDocument or NSXMLDocument?
- From: Charles Ross <email@hidden>
- Date: Sat, 23 Apr 2005 15:01:48 -0700
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
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden