I'm trying to achieve the equivalent of the following C# code:
someStringValue = someStringValue ?? string.Empty;
Where if someStringValue
is null, a value of string.Empty
(the empty string: ""
) will be assigned. How do I achieve this in Objective-C? Is my only option:
if(!someStringValue)
someStringValue = @"";
Solution thanks to @Dave DeLong:
someStringValue = someStringValue ?: @"";