• 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
Re: How to customize NSDocument's error message 'The document ... could not be opened'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to customize NSDocument's error message 'The document ... could not be opened'


  • Subject: Re: How to customize NSDocument's error message 'The document ... could not be opened'
  • From: John Timmer <email@hidden>
  • Date: Sun, 18 Sep 2005 11:40:25 -0400

> In a subclass of NSPersistentDocument, I override
> the method initWithContentsOfURL:ofType:error in
> order to check whether the document's format
> version is known.  If it is an unrecognized version,
> I create a suitable NSError and return nil.
>

You should override NSDocument's
- (void)presentError:(NSError *)error modalForWindow:(NSWindow *)window
delegate:(id)delegate didPresentSelector:(SEL)didPresentSelector
contextInfo:(void *)contextInfo

Method.  I put my error codes within a specific range, then trap that and
substitute custom error messages there.

Cheers,

JT


_______________________________________________
This mind intentionally left blank


 _______________________________________________
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

References: 
 >How to customize NSDocument's error message 'The document ... could not be opened' (From: Kaspar Fischer <email@hidden>)

  • Prev by Date: Re: Draggable buttons
  • Next by Date: Re: Newbie Q : show line numbers
  • Previous by thread: How to customize NSDocument's error message 'The document ... could not be opened'
  • Next by thread: Re: How to customize NSDocument's error message 'The document ... could not be opened'
  • Index(es):
    • Date
    • Thread