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

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

    <tfoot id='ybUrE'></tfoot>

  1. <legend id='ybUrE'><style id='ybUrE'><dir id='ybUrE'><q id='ybUrE'></q></dir></style></legend>
  2. <small id='ybUrE'></small><noframes id='ybUrE'>

    1. Objective-C 中的 bool、Boolean 和 BOOL 之间有什么区别吗?

      Is there any difference between bool, Boolean, and BOOL in Objective-C?(Objective-C 中的 bool、Boolean 和 BOOL 之间有什么区别吗?)

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

              <bdo id='qpBhw'></bdo><ul id='qpBhw'></ul>
            • <legend id='qpBhw'><style id='qpBhw'><dir id='qpBhw'><q id='qpBhw'></q></dir></style></legend>
            • <small id='qpBhw'></small><noframes id='qpBhw'>

                本文介绍了Objective-C 中的 bool、Boolean 和 BOOL 之间有什么区别吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我知道 BOOL 实际上是有符号字符的 typedef,但是 Boolean 呢?

                bool、Boolean 和 BOOL 有什么区别?

                解决方案

                Boolean 是一个旧的 Carbon 关键字(历史 Mac 类型),定义为 unsigned char.BOOL 是一种Objective-C 类型,定义为signed char.bool_Bool 标准 C 类型的定义版本.它被定义为一个int.使用 BOOL.

                编辑(2019 年):Apple 在一些 BOOL 的底层实现">新文档.基本上,在 macOS 上,BOOL 最终还是一个 signed char,但在 iOS 和相关平台上,它是一个原生的 C bool 下面.p>

                I know BOOL is actually a typedef of signed char, but what about Boolean?

                What is the difference between bool, Boolean and BOOL?

                解决方案

                Boolean is an old Carbon keyword (historic Mac type), defined as an unsigned char. BOOL is an Objective-C type defined as signed char. bool is a defined version of the _Bool standard C type. It's defined as an int. Use BOOL.

                Edit (2019): Apple talks about the underlying implementation of BOOL in some new documentation. Basically, on macOS, BOOL is still ultimately a signed char, but on iOS and related platforms, it a native C bool underneath.

                这篇关于Objective-C 中的 bool、Boolean 和 BOOL 之间有什么区别吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                SharedPreferences amp; boolean(SharedPreferences amp;布尔值)
                What values should I use for iOS boolean states?(我应该为 iOS 布尔状态使用什么值?)
                Converting Int to Bool(将 Int 转换为 Bool)
                Evaluate Bool property of optional object in if statement(在 if 语句中评估可选对象的 Bool 属性)
                Why does Objective-C use YES/NO macro convention instead of true/false?(为什么 Objective-C 使用 YES/NO 宏约定而不是 true/false?)
                How do I get NSJSONSerialization to output a boolean as true or false?(如何让 NSJSONSerialization 将布尔值输出为真或假?)
                <legend id='Lw2yU'><style id='Lw2yU'><dir id='Lw2yU'><q id='Lw2yU'></q></dir></style></legend>
                    <bdo id='Lw2yU'></bdo><ul id='Lw2yU'></ul>
                  • <tfoot id='Lw2yU'></tfoot>
                      1. <i id='Lw2yU'><tr id='Lw2yU'><dt id='Lw2yU'><q id='Lw2yU'><span id='Lw2yU'><b id='Lw2yU'><form id='Lw2yU'><ins id='Lw2yU'></ins><ul id='Lw2yU'></ul><sub id='Lw2yU'></sub></form><legend id='Lw2yU'></legend><bdo id='Lw2yU'><pre id='Lw2yU'><center id='Lw2yU'></center></pre></bdo></b><th id='Lw2yU'></th></span></q></dt></tr></i><div id='Lw2yU'><tfoot id='Lw2yU'></tfoot><dl id='Lw2yU'><fieldset id='Lw2yU'></fieldset></dl></div>

                          <tbody id='Lw2yU'></tbody>

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