objective c - What is the ?: operator -
in example of objective-c code found operator
self.itemviews[@(0)] ?: [self.datasource slidingviewstack:self viewforitematindex:0 reusingview:[self dequeueitemview]];
the code compile under apple llvm 4.2.
the thing came across in being vector operator, don't think objective-c, , matter c, has vector operators. can please give reference , or documentation of operator.
?:
c conditional operator.
a ? b : c
yields b
value if a
different 0
, c
if a
equal 0
.
a gnu extension (conditional omitted operand) allows use no second operand:
x ? : y
is equivalent to
x ? x : y
Comments
Post a Comment