delegate methods for webViewDidFinishLoad

102 weergaven
Naar het eerste ongelezen bericht

Jordan Redner

ongelezen,
20 jul 2008, 20:54:0220-07-2008
aan 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

ongelezen,
31 jul 2008, 03:58:5431-07-2008
aan iphone-map-view
Hi, I have the same question.... Did you fix this now ?

Karthik.Wifin

ongelezen,
31 jul 2008, 04:44:4831-07-2008
aan iphone-...@googlegroups.com
hi,

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


Thanks with,
Karthik

nickname

ongelezen,
31 jul 2008, 13:25:3631-07-2008
aan 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..
Allen beantwoorden
Auteur beantwoorden
Doorsturen
0 nieuwe berichten