setting delegate of a custom class
<p>i am working in creating a custom class which is subclass of UIWebview. But its delegate functions are not being called. How should i set delegate for this class. I know this is a basic question but it will be really good if some one could answer it. Thanks in advance.</p>

<p>My Code:</p>

<p>.h file</p>

<pre><code>@interface PollackWebView : UIWebView&lt;UIWebViewDelegate&gt; {



}

-(id)initWebview:(CGRect)frame;
@end
</code></pre>

<p>.m file:</p>

<pre><code>@implementation PollackWebView


-(id)initWebview:(CGRect)frame {

    if ((self = [super initWithFrame:frame])) {

    }
    return self;
}

-(void)SetMyDelegate {

    self.delegate = self;

}


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

    NSLog(@"shouldStartLoadWithRequest");
    if ( navigationType == UIWebViewNavigationTypeLinkClicked ) {

        // do something with [request URL]
        return NO;
    }

    return TRUE;

}

- (void)webViewDidStartLoad:(UIWebView *)webView {

    NSLog(@"webViewDidStartLoad");

}
</code></pre>
