Skip to content

Instantly share code, notes, and snippets.

@neverunlucky
Last active May 21, 2018 12:53
Show Gist options
  • Save neverunlucky/b26c06a2d478d7cf3c093da2eefdceb5 to your computer and use it in GitHub Desktop.
Save neverunlucky/b26c06a2d478d7cf3c093da2eefdceb5 to your computer and use it in GitHub Desktop.
Objective-C NSNumber (__NSCFNumber vs __NSCFBoolean)
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