是他们的任何类别的UIWebView可能的错误?在我的应用程序中,我需要显示加载url时发生的实际错误。我可以打印在didFailLoadWithError方法的错误,但在提供了有关错误类似分类UIWebView错误并显示在iPhone应用程序?
didFailLoadWithError Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo=0x895fb10 {NSErrorFailingURLStringKey=https://mobilelogin.bwanet.ca/mdninput.html?csphostid=J13y8E9t000Mb3ZK00001H7R, NSErrorFailingURLKey=https://mobilelogin.bwanet.ca/mdninput.html?csphostid=J13y8E9t000Mb3ZK00001H7R, NSLocalizedDescription=A server with the specified hostname could not be found., NSUnderlyingError=0x8c68f20 "A server with the specified hostname could not be found."}
我将如何分类,这些可能出现的错误很长的描述,我想喜欢 显示为“指定的主机找不到” “网址超时错误” 等
你看到所有那些“其他”?这就是为什么“switch”语句被发明出来的原因 – 2014-03-20 09:08:45
或更好的枚举myEnum {LoadingFaild = -1}词典 dict = new词典();; \t \t \t dict.Add(-1,“LoadingFailed”); \t \t \t Console.WriteLine(“Error loading = {0}”,dict [-1]); –
2014-09-26 14:48:02
或者dict [myEnum.LoadingFailed] – 2014-09-26 14:48:47