开发者

Better illustrating error message for NSXMLParser

Now the user only get a error message like "Error code 5".

NSString *errorString = [NSString stringWithFormat:@"Error code %i", [parseError code]];

UIAlertView *errorAlert = [[UIAlertView alloc] initWithTitle:@"Error loading content" message:errorString delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[errorAlert show];

S开发者_C百科o the NSXMLParserError code is not enough for me. I rather would like something like "NSXMLParserPrematureDocumentEndError" or "The document ended unexpectedly."

Is there an easy way to do this?

Cheers


Check NSError's localizedDescription, localizedFailureReason etc etc methods in NSError class reference

NSString *errorString = [parserError localizedDescription];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜