Last active
May 21, 2018 12:53
-
-
Save neverunlucky/b26c06a2d478d7cf3c093da2eefdceb5 to your computer and use it in GitHub Desktop.
Objective-C NSNumber (__NSCFNumber vs __NSCFBoolean)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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