I use the UIWebView to fetch and show a html page. I want to do something when the html finish loading,and show in ViewController , as the same time, the image is loading.
I use
(void)webViewDidFinishLoad:(UIWebView *)webView
to receive the call back. But it should take action after all the element finish loading ,and it will take maybe a minute. It is too slow.
If you want to know when the dom has loaded you must use javascript to listed for the dom loaded event, then call your Objective-c code when that has occured.
If it is your web page that is loading then you can add the necessary javascript at source, if its somebody else’s web page then you will need to inject the javascript into the page using stringByEvaluatingJavaScriptFromString.
To call Objective-C from Javascript once the dom loaded event has fired see here
http://blog.techno-barje.fr/post/2010/10/06/UIWebView-secrets-part3-How-to-properly-call-ObjectiveC-from-Javascript/