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.