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

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

        <tfoot id='dkTLr'></tfoot>
        <legend id='dkTLr'><style id='dkTLr'><dir id='dkTLr'><q id='dkTLr'></q></dir></style></legend>

      1. BOOL 的默认值

        时间:2023-09-08
        • <bdo id='MfV9m'></bdo><ul id='MfV9m'></ul>

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

              <tbody id='MfV9m'></tbody>
            <legend id='MfV9m'><style id='MfV9m'><dir id='MfV9m'><q id='MfV9m'></q></dir></style></legend>
          • <tfoot id='MfV9m'></tfoot>

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

                1. 本文介绍了BOOL 的默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  Objective-C 中 BOOL 变量的默认值是多少?

                  What is the default value of a BOOL variable in Objective-C?

                  推荐答案

                  没有写默认值

                  -(void)somemethod {
                    BOOL x;  // <--- no default value
                  

                  它被初始化为垃圾.

                  但是,对于 BOOL ivar,它将被初始化为 NO,因为在初始化时整个实例都被填充为 0.

                  However, for a BOOL ivar, it will be initialized to NO, as the whole instance is filled with 0 on initialization.

                  (注意:启用ARC后,本地对象指针将始终有一个默认值nil,但是像BOOL这样的非对象类型的局部变量仍然会被初始化垃圾.请参阅 局部变量设置为零?(Objective-C).)

                  (Note: When ARC is enabled, local object pointers will always be have a default value nil, but local variables of non-object types like BOOL are still initialized to garbage. See Local variables set to nil? (Objective-C).)

                  这篇关于BOOL 的默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:何时应该使用 initWithNibName 初始化视图控制器? 下一篇:从 xib 文件加载 ViewController

                  相关文章

                2. <small id='MeXaG'></small><noframes id='MeXaG'>

                  1. <tfoot id='MeXaG'></tfoot>
                  2. <legend id='MeXaG'><style id='MeXaG'><dir id='MeXaG'><q id='MeXaG'></q></dir></style></legend>

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