0

I think there are two boolean type we can use bool and BOOL. What's the difference between those two?

bool contains true and false; BOOL contains TRUE and FALSE, can they be interchangeable?

John Topley
  • 113,588
  • 46
  • 195
  • 237
user496949
  • 83,087
  • 147
  • 309
  • 426

2 Answers2

6

enter image description hereMattt has written a blog post about this:

Objective-C defines BOOL to encode truth value. It is a typedef of a signed char, with the macros YES and NO to represent true and false, respectively.

John Topley
  • 113,588
  • 46
  • 195
  • 237
CarlJ
  • 9,461
  • 3
  • 33
  • 47
2

bool is the datatype defined in C99.

BOOL is defined in Objective-C as typedef signed char BOOL.

Check out this Thread

Community
  • 1
  • 1
Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331