• <bdo id='5j9pp'></bdo><ul id='5j9pp'></ul>
    <legend id='5j9pp'><style id='5j9pp'><dir id='5j9pp'><q id='5j9pp'></q></dir></style></legend>

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

      <small id='5j9pp'></small><noframes id='5j9pp'>

        [[UIApplication sharedApplication] delegate] 的简写?

        时间:2023-09-12
          <bdo id='4fNjb'></bdo><ul id='4fNjb'></ul>

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

                1. <small id='4fNjb'></small><noframes id='4fNjb'>

                2. <tfoot id='4fNjb'></tfoot>

                  <legend id='4fNjb'><style id='4fNjb'><dir id='4fNjb'><q id='4fNjb'></q></dir></style></legend>
                    <tbody id='4fNjb'></tbody>
                  本文介绍了[[UIApplication sharedApplication] delegate] 的简写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我将全局变量存储在我的 AppDelegate 中并通过以下方式访问它们:

                  I stored global variables in my AppDelegate and access them by:

                  AppDelegate *d = [[UIApplication sharedApplication] delegate];
                  d.someString = ...
                  

                  什么是保存一些输入的推荐方法,所以我不需要一次又一次地 AppDelegate *d = [[UIApplication sharedApplication] delegate];?谢谢!

                  What's the recommend way to save some typing and so I don't need to AppDelegate *d = [[UIApplication sharedApplication] delegate]; again and again? Thanks!

                  推荐答案

                  正如Shaggy Frog所说,在YourAppDelegate.h文件中定义一个宏,示例如下:

                  As Shaggy Frog said, define a macro in your YourAppDelegate.h file, an example like this:

                  #define AppDelegate (YourAppDelegate *)[[UIApplication sharedApplication] delegate]
                  

                  然后您可以像这样在代码中获取应用委托:

                  Then you can get the app delegate in your code like this:

                  [AppDelegate ......];
                  

                  这篇关于[[UIApplication sharedApplication] delegate] 的简写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何使用委托将数据从 UIPageViewController 传递到子 ViewController 下一篇:NSURLSession 委托与 completionHandler

                  相关文章

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

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

                      <legend id='hgJgL'><style id='hgJgL'><dir id='hgJgL'><q id='hgJgL'></q></dir></style></legend>
                      • <bdo id='hgJgL'></bdo><ul id='hgJgL'></ul>