<tfoot id='o3vWT'></tfoot>

    <i id='o3vWT'><tr id='o3vWT'><dt id='o3vWT'><q id='o3vWT'><span id='o3vWT'><b id='o3vWT'><form id='o3vWT'><ins id='o3vWT'></ins><ul id='o3vWT'></ul><sub id='o3vWT'></sub></form><legend id='o3vWT'></legend><bdo id='o3vWT'><pre id='o3vWT'><center id='o3vWT'></center></pre></bdo></b><th id='o3vWT'></th></span></q></dt></tr></i><div id='o3vWT'><tfoot id='o3vWT'></tfoot><dl id='o3vWT'><fieldset id='o3vWT'></fieldset></dl></div>
  1. <legend id='o3vWT'><style id='o3vWT'><dir id='o3vWT'><q id='o3vWT'></q></dir></style></legend>

      <small id='o3vWT'></small><noframes id='o3vWT'>

      • <bdo id='o3vWT'></bdo><ul id='o3vWT'></ul>

      为 UIWebView 设置委托

      时间:2023-10-22
          <tbody id='bLcwK'></tbody>
        <legend id='bLcwK'><style id='bLcwK'><dir id='bLcwK'><q id='bLcwK'></q></dir></style></legend>
        <i id='bLcwK'><tr id='bLcwK'><dt id='bLcwK'><q id='bLcwK'><span id='bLcwK'><b id='bLcwK'><form id='bLcwK'><ins id='bLcwK'></ins><ul id='bLcwK'></ul><sub id='bLcwK'></sub></form><legend id='bLcwK'></legend><bdo id='bLcwK'><pre id='bLcwK'><center id='bLcwK'></center></pre></bdo></b><th id='bLcwK'></th></span></q></dt></tr></i><div id='bLcwK'><tfoot id='bLcwK'></tfoot><dl id='bLcwK'><fieldset id='bLcwK'></fieldset></dl></div>

          <small id='bLcwK'></small><noframes id='bLcwK'>

              • <bdo id='bLcwK'></bdo><ul id='bLcwK'></ul>
                <tfoot id='bLcwK'></tfoot>
              • 本文介绍了为 UIWebView 设置委托的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                如何为我的 UIWebView 设置委托以使用 webViewDidFinishLoad?

                How do I set a delegate for my UIWebView to use webViewDidFinishLoad?

                推荐答案

                在接口文件中注明你有兴趣:

                In the interface file indicate that you're interested:

                @interface SomethingController : UIViewController <UIWebViewDelegate> {
                


                然后在您的实现中添加该委托方法:


                Then in your implementation you'll add that delegate method:

                - (void)webViewDidFinishLoad:(UIWebView *)webView {
                
                    // Do whatever you want here
                
                }
                

                显然 SomethingController 应该是您的实际控制器,而 UIViewController 是您实际实现的任何东西.

                Obviously SomethingController should be your actual controller, and UIViewController is whatever you're actually implementing.

                顺便说一句,这基本上就是您实现任何委托的方式.

                This, by the way, is basically how you implement any delegate.

                编辑

                在基于窗口的应用中,假设您的 UIWebView 在您的应用委托中,您只需将其添加到委托列表中,用逗号分隔,如下所示:

                In a window-based app, assuming your UIWebView is in your app delegate, you just add it to the list of delegates, separated by commas, like this:

                @interface YourAppDelegate : NSObject <UIApplicationDelegate, UIWebViewDelegate>
                

                您将在应用委托的实现中包含您的 webViewDidFinishLoad.

                You'll include your webViewDidFinishLoad in the app delegate's implementation.

                编辑 2

                最后,您需要将 UIWebView 连接到控制器.通常在 UIViewController 的 viewDidLoad 方法中执行此操作,如下所示:

                Finally, you'll need to connect your UIWebView to your controller. It's common to do this in the viewDidLoad method of a UIViewController, with a line like this:

                self.yourWebView.delegate = self;
                

                这告诉 UIWebView 它应该在哪里发送消息.

                This tells the UIWebView where it should send messages.

                这篇关于为 UIWebView 设置委托的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:创建 UIWebView 并以编程方式加载网站 下一篇:iOS 6 - UIWebView loadHTMLString 无法正常工作

                相关文章

                    <bdo id='O9tpA'></bdo><ul id='O9tpA'></ul>

                1. <small id='O9tpA'></small><noframes id='O9tpA'>

                  <legend id='O9tpA'><style id='O9tpA'><dir id='O9tpA'><q id='O9tpA'></q></dir></style></legend>
                  <i id='O9tpA'><tr id='O9tpA'><dt id='O9tpA'><q id='O9tpA'><span id='O9tpA'><b id='O9tpA'><form id='O9tpA'><ins id='O9tpA'></ins><ul id='O9tpA'></ul><sub id='O9tpA'></sub></form><legend id='O9tpA'></legend><bdo id='O9tpA'><pre id='O9tpA'><center id='O9tpA'></center></pre></bdo></b><th id='O9tpA'></th></span></q></dt></tr></i><div id='O9tpA'><tfoot id='O9tpA'></tfoot><dl id='O9tpA'><fieldset id='O9tpA'></fieldset></dl></div>
                  <tfoot id='O9tpA'></tfoot>