Last active
July 23, 2020 09:37
-
-
Save sodastsai/7b6cdb9815621b46f44747b9de229a63 to your computer and use it in GitHub Desktop.
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
#import <Foundation/Foundation.h> | |
// clang -o main -framework Foundation main.m | |
int main(int argc, const char*argv[]) { | |
@autoreleasepool { | |
NSLog(@"%@", (@42).class); // __NSCFNumber | |
NSLog(@"%@", (@YES).class); // __NSCFBoolean | |
NSLog(@"%@", @"Hello".class); // __NSCFConstantString | |
NSLog(@"%@", [NSString stringWithFormat:@"%d", 42].class); // NSTaggedPointerString | |
NSLog(@"%@", [NSData dataWithBytes:"ABC" length:3].class); // _NSInlineData | |
NSLog(@"%@", [@"ABC" dataUsingEncoding:NSUTF8StringEncoding].class); // NSConcreteMutableData | |
NSLog(@"%@", @[@42].class); // __NSSingleObjectArrayI | |
NSLog(@"%@", @[@42, @43].class); // __NSArrayI | |
NSLog(@"%@", [NSArray array].class); // __NSArray0 | |
return 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment