What is the ?: operator
问题 In an example of Objective-C code I found this operator self.itemViews[@(0)] ?: [self.dataSource slidingViewStack:self viewForItemAtIndex:0 reusingView:[self dequeueItemView]]; The code does compile under Apple LLVM 4.2. The only thing I came across was in being a vector operator, but I don't think Objective-C, and for that matter C, has vector operators. So can someone please give reference and or documentation of this operator. 回答1: ?: is the C conditional operator . a ? b : c yields b