IOS - problems with canGoForward and canGoBack in webViewDidStartLoad

A simple concept, however, it does not work. I have two buttons in my UIWebViewback button and the forward button. The back buttons call [self.webView goBack] and forward [self.webView goForward] .

Now I want to know if I UIWebViewcan come back. If so, turn on the back button and return it, and the same goes for the forward button.

-(void)webViewDidStartLoad:(UIWebView *)webView
{    
    if([self.webView canGoForward]) {
        [forwardArrowBtn setEnabled:YES];
    } else {
        [forwardArrowBtn setEnabled:NO];
    }

    if([self.webView canGoBack]) {
        [backArrowBtn setEnabled:YES];
    } else {
        [backArrowBtn setEnabled:NO];
    }
}

, . : UIWebView, , "" - . , "" .

?

+5
4

, webViewDidStartLoad. webViewDidStartLoad, webViewDidFinishLoad shouldStartLoadWithRequest. .

+12

- ? , loadHTMLString, -, ( , , ). loadRequest, . , , . .

+3

, , "" , :

webViewDidStartLoad , . , , webViewDidFinishLoad . , , ( ). , - (). , , , , .

+1

, . , webView:loadRequest: webcontent? , , webView:loadData:MIMEType:textEncodingName:baseURL: loadHTMLString:baseURL:.

. webView:loadRequest: , - , .

0
source

All Articles