views:

29

answers:

1

Can anyone just clarify this for me, I was under the impression that to use webViewDidFinishLoad: I would have to conform my class to <UIWebViewDelegate>. However I forgot to do this but found it still works where I was expecting an error/warning. Can anyone explain for me?

-(void)webViewDidFinishLoad:(UIWebView *)webView {
    // do stuff ...
}

much appreciated,

Gary

+1  A: 

The methods in UIWebViewDelegate are supposed to be optionally implemented. If UIWebView would force you to implement the protocol by testing wether the delegate conforms to it, you'd always have the annoying warnings about your class not fully implementing the protocol.
UIWebViewDelegate effectively exists for self-documentation and in case you want to be warned about not fully implementing it. If you want these warnings, see Adopting a Protocol.

Georg Fritzsche
Thank you Georg, that explains it perfectly ...
fuzzygoat