Re: How to customize NSDocument's error message 'The document ... could not be opened'
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