Xcode does not give an error of my (thought-to-be) typo:
NSString *theme = [[NSUserDefaults standardUserDefaults] objectForKey:@"theme"];
NSLog(@"Theme: %@", theme ?: @"Default");
It turns out:
NSLog(@"Theme: %@", theme ?: @"Default");
works same as:
NSLog(@"Theme: %@", theme ? theme : @"Default");
Is the above shorten syntax good for gcc only? Or it is part of Objective-C?
It’s a GNU extension to the conditional expression in C:
From here: