看起来很简单,但不知道出了什么问题。我想在WebView
加载一个基本的URL,如下图所示在IOS中的Webview中加载URL时的奇怪行为
WebsiteWebView.delegate=self;
NSURL* url = [NSURL URLWithString:@"http://firstclasspizzaoc.com/"];
[WebsiteWebView loadRequest:[NSURLRequest requestWithURL:url]];
而载入我收到以下错误每次..
Error : Error Domain=NSURLErrorDomain Code=-999 "The operation couldn’t be completed. (NSURLErrorDomain error -999.)" UserInfo=0xe036d20 {NSErrorFailingURLKey=http://firstclasspizzaoc.com/, NSErrorFailingURLStringKey=http://firstclasspizzaoc.com/}
2014-01-07 15:18:46.142 FirstClassPizza[1583:
Error : Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo=0xe0ef310 {NSErrorFailingURLStringKey=XXXXXXXX, NSErrorFailingURLKey=XXXXXXXX, NSLocalizedDescription=A server with the specified hostname could not be found., NSUnderlyingError=0xcbe9130 "A server with the specified hostname could not be found."}
在浏览器它加载完美..
请提示我的代码出了什么问题..
任何有价值的建议将不胜感激...
感谢
我要说的是有一个与互联网连接 –
互联网连接的问题是工作的罚款......其他的URL加载... – Vidhyanand
你连接到任何防火墙,代理服务器等,可能会阻止它?也尝试添加www。以防万一 –