Possible Duplicate:
Is there a difference between YES/NO,TRUE/FALSE and true/false in objective-c?
I have one question, and it can be answered quickly. I have this code:
.h
UITableView *table;
.m
table.hidden = YES;
table.hidden = TRUE;
Is there any difference between the last two lines of code ? Or is EXACTLY the same YES and TRUE?
The TRUE
macro is only provided as backwards-compatibility with C code (Objective-C is designed to be a strict super-set of C). They both mean the same thing.
The original success value for BOOL
in Objective C is the YES
. TRUE
is just a mimic of it for compatibility. You can use both but I highly recommend you to use what was originally designed for the language. This is important in case future updates of the language changed anything in the syntax of the language (which is not likely to happen in this case), using the original syntax will not cause you to fix anything in your old code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With