In Objective-c, safe and good way to compare 2 BOOL values?
问题 I want to compare 2 BOOL values in objective-c. I found out that (3)-(6) of the following code works. (1)-(2) doesn't work because BOOL is just signed char . (3) works and is very readable but I think bool isn't objective-c. Using bool in objective-c code is good? Which is the safe and good way to compare 2 BOOL values in objective-c? Are there other better ways to compare? BOOL b = YES; BOOL c = 2; NSLog(@"(1) %d", b == c); // not work NSLog(@"(2) %d", (BOOL)b == (BOOL)c); // not work NSLog(