Objective-c里各种布尔类型什么区别

boolean_t t;
Boolean tt;
BOOL ttt;
bool tttt;

bool 是int
BOOL 是char

bool b1 当b1>0 就=YES
BOOL b2 当b2=1 才=YES

所以框架都用BOOL

Boolean mac os上有历史意义的类型

Boolean types and values
    
        Boolean         Mac OS historic type, sizeof(Boolean)==1
        bool            Defined in stdbool.h, ISO C/C++ standard type
        false           Now defined in stdbool.h
        true            Now defined in stdbool.h

boolean_t i386

/*
 *      File:   boolean.h
 *
 *      Boolean type, for I386.
 */

#ifndef _MACH_I386_BOOLEAN_H_
#define _MACH_I386_BOOLEAN_H_

#if defined(__x86_64__) && !defined(KERNEL)
typedef unsigned int    boolean_t;
#else
typedef int             boolean_t;
#endif

#endif  /* _MACH_I386_BOOLEAN_H_ */

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值