delegate methods for webViewDidFinishLoad

101 views
Skip to first unread message

Jordan Redner

unread,
Jul 20, 2008, 8:54:02 PM7/20/08
to iphone-...@googlegroups.com
Hi,

Does anyone have an idea of how to put a hook in (to show a progress
indicator of some kind) to webViewDidFinishLoad?

I don't understand what is happening with this syntax;

@property (retain, getter = delegate) id <MapWebViewDelegate> mDelegate;


Otherwise, if this isn't possible with this delegate method, other
ideas welcome!

thanks,


Jordan

syd

unread,
Jul 31, 2008, 3:58:54 AM7/31/08
to iphone-map-view
Hi, I have the same question.... Did you fix this now ?

Karthik.Wifin

unread,
Jul 31, 2008, 4:44:48 AM7/31/08
to iphone-...@googlegroups.com
hi,

me too cant understand what is meant that syntax, any body knows ans
please explain me.


Thanks with,
Karthik

nickname

unread,
Jul 31, 2008, 1:25:36 PM7/31/08
to iphone-map-view
That property statement is overriding the default delegate of
UIWebView.

I am new to Obj-c and Cocoa, but what I did was change the
MapViewDelegate to
extend UIWebView delegate protocol rather than replace it.
Then your delegate can respond to all messages.

Here is what I did and seems to work, (if this is the wrong way to do
it maybe someone
can suggest a better way?).

1) In MapWebView.h, change protocal definition to this:
@protocol MapWebViewDelegate <UIWebViewDelegate>

2) In MapWebView.m, remove:

//@synthesize delegate;

and replace with own methods, to hook into super.delegate:

- (id <MapWebViewDelegate>) delegate {
return (id <MapWebViewDelegate>)super.delegate;
}

- (void) setDelegate :(id <MapWebViewDelegate>) delegate {
super.delegate = delegate;
}

Then you should be able to set the delegate and respond to:

- (void)webViewDidFinishLoad:(UIWebView *)webView ;

etc..
Reply all
Reply to author
Forward
0 new messages