Source: http://snipplr.com/view/29213/uiwebview-displaying-a-network-loading/
URL: http://www.iphonedevsdk.com/forum/iphone-sdk-development-advanced-discussion/15077-uiwebview-not-calling-webviewdidfinishload.html
This works fine on my app.
# Import <uikit/uikit. h> </P> <p> @ interface classname: uiviewcontroller <uiwebviewdelegate >{< br/> uiwebview * mywebview; <br/>}< br/> @ end </P> <p> # import "classname. H "<br/> @ implementation classname <br/> // implement loadview to create a view hierarchy programmatically, without using a nib. <br/>-(void) loadview {<br/> uiview * contentview = [[uiview alloc] initwithframe: [[uiscreen mainscreen] applicationframe]; <br/> self. view = contentview; </P> <p> cgrect webframe = [[uiscreen mainscreen] applicationframe]; <br/> webframe. origin. y = 0.0; <br/> mywebview = [[uiwebview alloc] initwithframe: webframe]; <br/> mywebview. backgroundcolor = [uicolor whitecolor]; <br/> mywebview. scalespagetofit = yes; <br/> mywebview. autoresizingmask = (uiviewautoresizingflexiblewidth | uiviewautoresizingflexibleheight); <br/> mywebview. delegate = self; <br/> [self. view addsubview: mywebview]; <br/> [mywebview loadrequest: [nsurlrequest requestwithurl: [nsurl urlwithstring: @ "http://www.google.com/"]; <br/>}< br/> # pragma mark uiwebview delegate methods <br/>-(void) webviewdidstartload :( uiwebview *) webview <br/> {<br/> // starting the load, show the activity indicator in the status bar <br/> [uiapplication sharedapplication]. networkactivityindicatorvisible = yes; <br/>}< br/>-(void) webviewdidfinishload :( uiwebview *) webview <br/>{< br/> // finished loading, hide the activity indicator in the status bar <br/> [uiapplication sharedapplication]. networkactivityindicatorvisible = no; <br/>}< br/>-(void) webview :( uiwebview *) webview didfailloadwitherror :( nserror *) error <br/> {<br/> // load error, hide the activity indicator in the status bar <br/> [uiapplication sharedapplication]. networkactivityindicatorvisible = no; </P> <p> // report the error inside the webview <br/> nsstring * errorstring = [nsstring stringwithformat: <br/> @ "<HTML> <center> <font size = + 5 color = 'red'> An error occurred: <br >%@ </font> </center> </ptml> ", <br/> error. localizeddescription]; <br/> [mywebview loadhtmlstring: errorstring baseurl: Nil]; <br/>}< br/>-(void) didreceivememorywarning {<br/> [Super didreceivememorywarning]; // releases the view if it doesn' t have a superview <br/> // release anything that's not essential, such as cached data <br/>}</P> <p>-(void) dealloc {<br/> [Super dealloc]; <br/>}</P> <p> @ end