I'm new to Objective-C and I wonder why this method compiles, can someone explain to me why?
thank
-(BOOL) isEnabled{ return 56; }
A BOOLin Objective-C is typedefof signed char. Since it 56is suitable for this type, an implicit conversion from a literal intresults in no data loss.
BOOL
typedef
signed char
56
int
You can think of BOOL in objective-c as
false === 0 === nil //Anything that is zero or nil is false true = !false //Anything that is NOT zero or nil is true.
56 therefore returns true because it is not zero