<tfoot id='EDFLX'></tfoot>
  • <small id='EDFLX'></small><noframes id='EDFLX'>

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

      <legend id='EDFLX'><style id='EDFLX'><dir id='EDFLX'><q id='EDFLX'></q></dir></style></legend>

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

        使用 App Delegate 访问通过 Storyboard 创建的视图控制

        时间:2023-05-31
        <legend id='ULNUr'><style id='ULNUr'><dir id='ULNUr'><q id='ULNUr'></q></dir></style></legend>
          <bdo id='ULNUr'></bdo><ul id='ULNUr'></ul>

              <tbody id='ULNUr'></tbody>

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

                • <small id='ULNUr'></small><noframes id='ULNUr'>

                  <tfoot id='ULNUr'></tfoot>
                  本文介绍了使用 App Delegate 访问通过 Storyboard 创建的视图控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在使用情节提要开发一个 iOS5 应用程序,并且我在视图控制器类中有一个方法,我想从 App Delegate 访问该方法.问题是,这个视图控制器是通过故事板中的标签栏控制器实例化的,所以 App Delegate 无法直接调用我想要的方法......

                  I'm working on an iOS5 app using storyboard, and I have a method in a view controller class that i'd like to access from the App Delegate. The trouble is, this view controller gets instantiated via a tab bar controller in storyboard, so the App Delegate has no direct way of calling the method I want...

                  要让视图控制器与 App Delegate 取得联系,只需使用:

                  For a view controller to get in touch with the App Delegate, all one has to do is use:

                  MyAppDelegate *appDelegate = (MyAppDelegate *)[[UIApplication sharedApplication] delegate];
                  

                  是否有类似的简单方法可以指向已经实例化的视图控制器或类?

                  Is there a similarly easy way of pointing to an already-instantiated view controller or class?

                  推荐答案

                  您必须从应用委托遍历视图层次结构.假设 AppDelegate 包含对 UITabBarController 的引用,您可以使用 viewControllers 属性或 selectedViewController 属性来获取你的视图控制器.

                  You'll have to traverse the view hierarchy from the app delegate. Assuming the AppDelegate holds a reference to the UITabBarController, you could use the viewControllers property or selectedViewController property to get to your view controller.

                  这篇关于使用 App Delegate 访问通过 Storyboard 创建的视图控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何在界面生成器中制作与 4 英寸 iPhone 兼容的 下一篇:如何禁用 UITextview 选择文本,复制/粘贴 UIMenuCo

                  相关文章

                  最新文章

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

                • <tfoot id='GqaH1'></tfoot>

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

                    <legend id='GqaH1'><style id='GqaH1'><dir id='GqaH1'><q id='GqaH1'></q></dir></style></legend>

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