Mac how to get notified when webview finished loading

DavidBlack

macrumors 6502a
Original poster
Jan 27, 2013
606
238
Somewhere In Apple's HQ ;)
Ok I want to know when my webview which is name youtubewebviewview to know when it's finish loading. I am using this code from apple but it seem like it's not getting called I used break points to make sure.

Code:
- (void)webView:(WebView *)sender didStartProvisionalLoadForFrame:(WebFrame *)frame
{
    // Only report feedback for the main frame.
    if (frame == [sender mainFrame]){
        NSString *url = [[[[frame provisionalDataSource] request] URL] absoluteString];
        [textField setStringValue:url];
    }
}
 

Meir David

macrumors newbie
Jun 13, 2013
23
0
hi dude

Here is a code for you

Just implement WebViewClient and extend onPageFinished() as follows:



mWebView.setWebViewClient(new WebViewClient() {

public void onPageFinished(WebView view, String url) {
// do your stuff here
}
});
 

chown33

Moderator
Staff member
Aug 9, 2009
8,495
4,503
Restivus
hi dude

Here is a code for you

Just implement WebViewClient and extend onPageFinished() as follows:

mWebView.setWebViewClient(new WebViewClient() {

public void onPageFinished(WebView view, String url) {
// do your stuff here
}
});
This is completely wrong.

The question was asked in Objective-C. This "answer" is in Java, most likely for Android, since WebViewClient seems to be android.webkit.WebViewClient.
 

DavidBlack

macrumors 6502a
Original poster
Jan 27, 2013
606
238
Somewhere In Apple's HQ ;)
This is completely wrong.

The question was asked in Objective-C. This "answer" is in Java, most likely for Android, since WebViewClient seems to be android.webkit.WebViewClient.
I have figured this out a long time ago but thanks for the help :). That Objective C book is helping me understand the concept much better :). :cool: