Re: Converting error codes to readable strings?
Re: Converting error codes to readable strings?
- Subject: Re: Converting error codes to readable strings?
- From: Camillo Lugaresi <email@hidden>
- Date: Fri, 3 Feb 2006 14:30:37 +0100
On 03/feb/06, at 14:04, Jonathan del Strother wrote:
On 3 Feb 2006, at 12:50, Camillo Lugaresi wrote:
On 02/feb/06, at 17:22, Jonathan del Strother wrote:
Is there any way to convert error enums into readable strings?
For example, the NSXMLParser might give me parse error number 76,
and I have to go look that up to find that that corresponds to
NSXMLParserTagNameMismatchError. Not very helpful for users who
don't have the NSXMLParser.h header file...
I suppose I could produce my own switch statement to produce an
error string for every NSXMLParserError enum value, but is there
a better way?
NSError's localizedDescription method might help.
Sadly not - that just returns something along the lines of
"NSXMLParserErrorDomain error 76"
Apple got lazy. Well, you could use GCC-XML to convert Foundation/
NSXMLParser.h to XML, then extract the NSXMLParserError enum and
convert it to a plist using xsltproc. Then you can load a dictionary
that maps numbers to strings out of the plist.
What's with the [High Spam] in your subject, btw?
Camillo
_______________________________________________
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