This is a ternary operator (also available in C, for which Objective-C is a superset and other languages ββthat it has borrowed).
? expression before evaluated first ? ; if he evaluates a value other than zero, the subexpression before : taken as the overall result; otherwise, a subexpression after the colon is executed :
Note that the subexpressions on both sides : must be of the same type.
Also note that using a macro to calculate MAX may produce unexpected results if the arguments have side effects. For example, MAX(++a, --b) will lead to a double side effect for one of the operands.
source share