Skip to content

Instantly share code, notes, and snippets.

@serkodev
Created November 5, 2018 10:54
Show Gist options
  • Select an option

  • Save serkodev/7243e212a9e61db41734f03fdfd24fc3 to your computer and use it in GitHub Desktop.

Select an option

Save serkodev/7243e212a9e61db41734f03fdfd24fc3 to your computer and use it in GitHub Desktop.
BOOL foo = YES;
id a = @(foo);
//className: __NSCFBoolean
id b = @(YES);
//className: __NSCFBoolean
id c = foo ? @(YES) : @(NO);
//className: __NSCFBoolean
id d = @(foo ? YES : NO);
//className: __NSCFNumber
id e = @(foo ? (BOOL)YES : (BOOL)NO);
//className: __NSCFNumber
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment