Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jun 16, 2013, 09:06 AM   #1
DavidBlack
macrumors Demi-God
 
Join Date: Jan 2013
Location: Somewhere In Apple's HQ ;)
how to get notified when webview finished loading

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];
    }
}
DavidBlack is offline   0 Reply With Quote
Old Jun 16, 2013, 10:16 AM   #2
Red Menace
macrumors regular
 
Join Date: May 2011
Location: Littleton, Colorado, USA
Take a look at webView:didFinishLoadForFrame
__________________
MacBook Pro / OS X Mavericks (10.9.2) / Xcode 5.1 / [and various (much) older stuff keeping dust off the shelves]
Red Menace is offline   0 Reply With Quote
Old Jun 26, 2013, 06:25 AM   #3
Meir David
macrumors newbie
 
Join Date: Jun 2013
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
}
});
Meir David is offline   0 Reply With Quote
Old Jun 26, 2013, 02:09 PM   #4
chown33
macrumors 603
 
Join Date: Aug 2009
Quote:
Originally Posted by Meir David View Post
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.
chown33 is offline   1 Reply With Quote
Old Jun 28, 2013, 03:07 PM   #5
DavidBlack
Thread Starter
macrumors Demi-God
 
Join Date: Jan 2013
Location: Somewhere In Apple's HQ ;)
Quote:
Originally Posted by chown33 View Post
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 .
DavidBlack is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:20 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC