I was typing a comment in Xcode, but forgot the leading //
. I noticed that and
was highlighted like a keyword. I did a bit of Googling, but I can't seem to figure out what it does (or even if it's a real keyword).
What does it mean?
The leading minus sign (-) tells the Objective-C compiler that the method is an instance method. The only other option is a plus sign (+), which indicates a class method. A class method is one that performs some operation on the class itself, such as creating a new instance of the class.
The __block Storage Type __block variables live in storage that is shared between the lexical scope of the variable and all blocks and block copies declared or created within the variable's lexical scope.
Objective-C uses all of the same logical operators as C. || is the logical-or operator.
You really can't use C in Objective-C, since Objective-C is C. The term is usually applied when you write code that uses C structures and calls C functions directly, instead of using Objective-C objects and messages.
It's a synonym for &&
. See iso646.h.
It is not a keyword. Objective-C shares exactly the same keywords as C with additional ones that always start with '@'.
EDIT: This question doesn't answer the original post (see Rob Napier's succint answer for this), but rather it highlights that 'and' is a macro in some standard library headers and not a reserved word.
Quote from the C standard (C11, n1570), page 58:
6.4.1 Keywords
keyword: one of auto, break, case, ... [list of words not including 'and']
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