• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Document opening question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Opening a sheet in a non document project?
  • Next by Date: Re: Localized alert function?
  • Previous by thread: Xcode: Setting window to ignore mouse click events & Build problems
  • Next by thread: Re: Document opening question
  • Index(es):
    • Date
    • Thread