What does this line of code mean?
label.frame = (inPseudoEditMode) ? kLabelIndentedRect : kLabelRect;
The ?
and :
Fun fact, in objective-c if you want to check null / nil For example:
-(NSString*) getSomeStringSafeCheck
{
NSString *string = [self getSomeString];
if(string != nil){
return String;
}
return @"";
}
The quick way to do it is:
-(NSString*) getSomeStringSafeCheck
{
return [self getSomeString] != nil ? [self getSomeString] : @"";
}
Then you can update it to a simplest way:
-(NSString*) getSomeStringSafeCheck
{
return [self getSomeString]?: @"";
}
Because in Objective-C:
So let say you write:
[self getSomeString] != nil?: @"";
the second parameter is returning a boolean value, thus a exception is thrown.