Does Objective-C have an even shorter way of writing this line of code?
a = b ? b : c;
That is, a way to say, a
is equal to b
as long it is not nil
, else c
. This is like Ruby's operator ||=
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…