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

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -