iPhone OS Reference Library Apple Developer Connection spyglass button

UIWebViewDelegate Protocol Reference

Conforms to
Framework
/System/Library/Frameworks/UIKit.framework
Availability
Available in iPhone OS 2.0 and later.
Declared in
UIWebView.h
Related sample code

Overview

The UIWebViewDelegate protocol defines methods that a delegate of a UIWebView object can optionally implement to intervene when web content is loaded.

Important: Before releasing an instance of UIWebView for which you have set a delegate, you must first set the UIWebView delegate property to nil before disposing of the UIWebView instance. This can be done, for example, in the dealloc method where you dispose of the UIWebView.

Tasks

Loading Content

Instance Methods

webView:didFailLoadWithError:

Sent if a web view failed to load content.

- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error

Parameters
webView

The web view that failed to load content.

error

The error that occurred during loading.

Availability
See Also
Declared In
UIWebView.h

webView:shouldStartLoadWithRequest:navigationType:

Sent before a web view begins loading content.

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType

Parameters
webView

The web view that is about to load content.

request

The content location.

navigationType

The type of user action that started the load request.

Return Value

YES if the web view should begin loading content; otherwise, NO .

Availability
See Also
Declared In
UIWebView.h

webViewDidFinishLoad:

Sent after a web view finishes loading content.

- (void)webViewDidFinishLoad:(UIWebView *)webView

Parameters
webView

The web view has finished loading.

Availability
See Also
Declared In
UIWebView.h

webViewDidStartLoad:

Sent after a web view starts loading content.

- (void)webViewDidStartLoad:(UIWebView *)webView

Parameters
webView

The web view that has begun loading content.

Availability
See Also
Declared In
UIWebView.h

Last updated: 2008-10-15

Did this document help you? Yes It's good, but... Not helpful...