That's because BOOL
is not bool
.
BOOL
is a just a non-standard (Objective-C-specific) typedef for a (non-bool
) integral type (as far as I know, it's always signed char
but I might be wrong). As such, it does not behave as a true Boolean data type, but rather as its underlying integral type. So, if you assign 64
to it, it will store 64 (and not true
or 1
). It is possible that, as a result of this, an operation that always assumes the true
value to be 1 (i. e. the LSB set) will fail to recognize 64 as such.
In contrast, if you replaced BOOL
with the true C99 Boolean type, which is _Bool
or bool
, then you would experience the expected behavior. I. e., assigning any non-zero value to the variable would have it store true
or 1
, regardless to whether that value was really 1.