English 中文(简体)
如何调用Webviewdidishfinish 代表方式 网络查看可可?
原标题:How to call webviewdidfinishload delegate method of web view in cocoa?

I am using the WebViewDidFinishLoad delegate Method of WebView, but it is not getting called. Whenever I run the application and load request in a WebView. Please tell me, how to call the method and which delegate I need to connect with the file owner.

Any help will be appreciated. Thanks in advance.

最佳回答

你在对另一个答案的评论中说:

- (void)webViewDidFinishLoad:(WebView *)webView{ NSLog(@"hello");}

此方法没有被调用 。

这是因为没有这种方法。

WebView和UIWebView不是一回事。 前者在Mac上的 WebKit框架中;后者在iOS上的UIKit框架中。 WebView不在iOS上, UIWebView不在Mac上。

UIWebView 是一个非常脱光的 WebView 版本。 特别是, UIWebView 只有一个代表协议, 其中 < code>webWibWibDid FinishLoad: 是其方法之一, 而WebView 不少于 6 代表协议。

webView didfinishLoad: 仅存在于 iOS 应用程序的 UIWebViewDelgate 协议中。 在 Mac 应用程序中执行它不会取得任何效果, 因为没有任何东西会称之为它 。

请告诉我该如何称呼这个方法...

这对你们没有好处, 因为执行它的全部目的就是找出一个负荷何时完成。 要给您自己取名, 您需要知道 '时间 '/ 时间' 何时才能称之为它 - 也就是说, 当负荷完成时。 要知道, 您需要被告知WebKit 完成了一个负荷。 正如人们在逻辑上所说, 这是 < a href=" http://en.wikipedia. org/ wiki/ begging_the_ question' rel= “ no follow” > 提出问题 。

正确的解决方案是将正确的代表设定为符合正确的代表协议和执行正确方法的对象。 正确的代表是 < a href="http:// developer. apple.com/library/mac/documentation/ Cocoa/Reference/WebView_Class/Reference/Reference.html#/ apple_ refrey_ref/ octm/ webView/ setFrameloadDegate% 3a" rel=nolfolf" > > frerefolreater_refer. applement_ apple.comcom/reformation_refread3_reformation_refread3 > the webrefread_loadDelement_loadDelegate_ refrealation_ referate_ refer a referme a refermotion_ reformalde a coilation_ reforation_ reformation_ reforation_ reforation_ reforation_ refrea/ refrea_ refread_ recoal kate_ recoal


具有相同问题的可可触摸程序员( webWibViewDid Finnish Load: not getting) 应确保他们的UIWebView 代表设置到正确的对象。 如果您重新设置代码, 请确认您正在与正确的网络视图交谈, 也就是说, 您对网络视图的输出是连接的( 如果在书签或书签中), 您会重新装入 nib 或 storyboard (如果在其中出现的话), 并且您不会用不同的网络视图( 一个来自 nib, 然后在代码中创建, 或者反之 ) 来截断出口的价值 。

问题回答

尝试添加 (并替换 myUIWbView , 替换为您的 UIWbView outlet 名称 ):

[myUIWebView setDelegate:self];

在页眉文件中添加 , 这样您就可以使用此方法 :

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

}
-(void)webViewDidFinishLoad:(UIWebView *)webView{

}

与文件所有者共享的网络浏览首端 Bound 资源门户

(void)webView:(WebView *)sender resource:(id)identifier didFinishLoadingFromDataSource:(WebDataSource *)dataSource

这对我很管用





相关问题
How do you create UIBarButtonItems with a radio interface?

I have a UIToolbar that needs three buttons in a radio style, meaning that of the three, only one button can be pushed at a time. The documentation makes reference to the possibility of setting up ...

iPhone settings bundle

I want to allow the user to enter a valid date using the iPhone’s settings application. I have experimented with many of the PreferenceSpecifiers data node types including date. I have two issues: ...

Circular #import/@class problem in ObjectiveC

I m going to use an example to properly illustrate my confusion. I can t quite wrap my head around this. In Cocoa touch, we have UIViewController and its subclass, UINavigationController. Now, UIVC ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Cocoa-Touch: issue looping MPMoviePlayerController

I have an app which has to load some data at startup, so I want to display a splash-screen animation. I m using the MPMoviePlayerController to play a m4v file. The movie has it s background set to [...

Iphone sequential animation with setAnimationDelay

I m trying to chain animation events. The application I m coding for work has a multiple choice quiz. First you pick your multiple choice answer. The quiz view fades away. Then a label ("correct" or "...

热门标签