UIWebViewDelegate methods not getting called

烈酒焚心 提交于 2020-01-11 09:20:48

问题


I want to use UIWebViewDelegate methods. I set its delegate to self but still not working

-(void)webViewDidStartLoad:(UIWebView *)webView {
    NSLog(@"Load view");    
}   

-(void)webViewDidFinishLoad:(UIWebView *)webView {
    NSLog(@"Finish View");   
}


-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
    NSLog(@"Error in loading: %@", [error description]);
}

回答1:


Do not write anything in viewDidLoad. Try putting webview related code viewDidAppear or any custom method. Cross check if your webview is connected properly in storyboard.



来源:https://stackoverflow.com/questions/27646876/uiwebviewdelegate-methods-not-getting-called

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!