Document opening question
Document opening question
- Subject: Document opening question
- From: Darrin Cardani <email@hidden>
- Date: Tue, 25 Nov 2003 13:52:39 -0600
My NSDocument subclass overrides -loadDataRepresentation:ofType: to
read in its XML-based documents. If, in reading the document, it
detects something wrong in the file (the file is corrupt, or has URLs
to things that don't exist, or something like that),
-loadDataRepresentation:ofType: returns NO. However, it appears that
the superclass still goes ahead and loads the document nib, and
creates the document windows, etc.
I've found that if I raise an exception that I don't handle in
-loadDataRepresentation:ofType:, then the superclass doesn't create
any of the windows. Is this the proper way to tell the superclass (or
the application) that reading the data failed and not to create the
windows? Will this properly clean up the document that got half-way
created during reading of the file?
Thanks,
Darrin
--
Darrin Cardani - email@hidden
President, Buena Software, Inc.
<
http://www.buena.com/>
Video, Image and Audio Processing Development
_______________________________________________
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.