2014-02-13 64 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不作任何其他請求它的工作原理 –

相關問題