My Xcode do not have BOOL


One of an example in this chapter is as below.

BOOL isNotLegal = !((truckWeight >0.0) && (truckWeight < 40000.0));
if (isNotLegal) {
printf(“Truck weight is not within legal range. \n”);

I am using Xcode 5.1.1, and it does not seems to have a syntax named ‘BOOL’. The error message is "use of undeclared identifier “BOOL”.

Please help.


Not sure if you found the answer yet, but here is a line pulled from the end of that section:

“To use BOOL in a C function, like main(), you would need to include in your program the file where this type is defined: #include < objc/ objc.h >”

Hope this helps!