2014-02-13 39 views
0

我试图打开uiwebview中的链接,它不打开并抛出错误。UIWebView不打开一个链接,但野生动物园做

Error Domain=NSURLErrorDomain Code=-999 "The operation couldn’t be completed. (NSURLErrorDomain error -999.)" UserInfo=0x9a2b020 {NSErrorFailingURLKey=http://epapir.info/apotek1/1402/#/1/, NSErrorFailingURLStringKey=http://epapir.info/apotek1/1402/#/1/} 

,并显示图像enter image description here

请advise.It在Safari浏览器中打开在iPhone和运作良好there.Following是我的代码。

- (void)viewDidLoad 
{ 
    [super viewDidLoad]; 

    NSURL *url = [NSURL URLWithString:urlAddress]; 

    //URL Requst Object 
    NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; 

    //Load the request in the UIWebView. 
    [webView loadRequest:requestObj]; 
} 

- (void)didReceiveMemoryWarning 
{ 
    [super didReceiveMemoryWarning]; 
    // Dispose of any resources that can be recreated. 
} 
-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error 
{ 
    [activity stopAnimating]; 

} 
-(void)webViewDidFinishLoad:(UIWebView *)webView 
{ 
    [activity stopAnimating]; 
} 

1. https://github.com/mariohahn/MHVideoPhotoGallery

2. https://github.com/hpique/Haneke

https://github.com/muhku/FreeStreamer

https://github.com/douban/DOUAudioStreamer

https://www.cocoacontrols.com/controls/nprimageview

https://github.com/spoletto/SPUserResizableView

http://www.appcoda.com/ios-programming-import-contact-address-book/

http://code.tutsplus.com/tutorials/forward-geocoding-with-clgeocoder--mobile-11011

http://paxcel.net/blog/expandablecollapsible-table-for-ios/

https://github.com/jdriscoll/ads-sample-stock-price-fetcher

https://github.com/aporat/KKProgressToolbar

http://www.appcoda.com/background-transfer-service-ios7/ https://github.com/iPhoneNoobDeveloper/Pinterest-Demo/blob/master/CHTCollectionViewWaterfallLayout.m

https://github.com/summerblue/iOS-6-Recipes-SourceCode

http://joris.kluivers.nl/blog/2013/01/15/custom-view-controller-transitions-using-uistoryboardsegues/

http://www.appcoda.com/objective-c-blocks-tutorial/

http://useyourloaf.com/blog/2010/09/13/repeating-an-ios-local-notification.html http://www.java2s.com/Open-Source/Objective_C_Free_Code/Animation/List_of_Free_code_Animation.htm

+1

出于好奇,为什么链接哈内克用这个? – hpique

回答

-1

就在您的didFailLoadWithError添加的NSLog和检查

-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error 
{ 
[activity stopAnimating]; 
    NSLog(@"ERROR : %@",error); //Get informed of the error FIRST 
    } 
+0

我已经发布了该错误。 –

0

尝试这样的事情..

if ([[UIApplication sharedApplication]canOpenURL:url]) 

{ [UIApplication的sharedApplication]的OpenURL:URL]。

 } 

在VoewDidappear方法虽然

+0

我想知道这个网站没有在uiwebview上打开的原因是什么。 –

+0

它发生在我之前,它与我们正在打的URL有关......事实证明,这件事情发生之前,我们正在提出另一个请求,之前的请求已经完成加载 – Geet

+0

不仅仅是击中thr url不作任何其他请求它的工作原理 –

相关问题