ios - set a delegate for UIWebView -
i stuck on this.. how set delegate uiwebview use webviewdidfinishload?
in interface file indicate you're interested:
@interface somethingcontroller : uiviewcontroller <uiwebviewdelegate> {
in implementation you'll add delegate method:
- (void)webviewdidfinishload:(uiwebview *)webview { // whatever want here } obviously somethingcontroller should actual controller, , uiviewcontroller whatever you're implementing.
this, way, how implement delegate.
edit
in window-based app, assuming uiwebview in app delegate, add list of delegates, separated commas, this:
@interface yourappdelegate : nsobject <uiapplicationdelegate, uiwebviewdelegate> you'll include webviewdidfinishload in app delegate's implementation.
edit 2
finally, you'll need connect uiwebview controller. it's common in viewdidload method of uiviewcontroller, line this:
self.yourwebview.delegate = self; this tells uiwebview should send messages.
Comments
Post a Comment