Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Knowing when WebView load has completed



Hi,

Another dumb question. I want to get the HTML text for the web page that is being displayed in my WebView. I found a code snippet in the archives that does that, but I need to know when all of the data has been loaded.

Another search led me to:
- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame*)frame

If I register as the FrameLoadDelegate so I receive these calls, then when (frame == [myWebView mainFrame]) is the loading complete?

I tried this with ebay.com and I saw one call to didFinishLoadForFrame AFTER I had received the one that had the mainFrame ID, so I am suspicious of my approach. It looks like I got all of the data by copying it when I saw mainFrame, but there are race conditions galore.

The only other approach I can see is to count calls to webView:didCommitLoadForFrame and count down calls to webView:didFinishLoadForFrame and webView:didFailLoadWithError:forFrame and whenever they go to zero I conclude that a page load has completed.

Does anyone have a definitive answer?

Thanks,
Rush
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.