Created
February 12, 2012 16:23
-
-
Save valexa/1809438 to your computer and use it in GitHub Desktop.
nsstrings
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
NSString *foo = @"foo"; | |
NSString *bar = [NSString stringWithString:@"bar"]; | |
NSString *baz = [[NSString alloc] initWithString:@"baz"]; | |
NSMutableString *bax = [NSMutableString stringWithString:@"bax"]; | |
NSData *objData = [NSData dataWithBytes:foo length:malloc_size(foo)]; | |
NSLog(@"%s foo contains %@, hash %lu, retain %i",class_getName(object_getClass(foo)),objData,[foo hash],[foo retainCount]); | |
objData = [NSData dataWithBytes:bar length:malloc_size(bar)]; | |
NSLog(@"%s bar contains %@, hash %lu, retain %i",class_getName(object_getClass(bar)),objData,[bar hash],[bar retainCount]); | |
objData = [NSData dataWithBytes:baz length:malloc_size(baz)]; | |
NSLog(@"%s baz contains %@, hash %lu, retain %i",class_getName(object_getClass(baz)),objData,[baz hash],[baz retainCount]); | |
objData = [NSData dataWithBytes:bax length:malloc_size(bax)]; | |
NSLog(@"%s bax contains %@, hash %lu, retain %i",class_getName(object_getClass(bax)),objData,[bax hash],[bax retainCount]); | |
2012-02-12 19:40:32.642 SandBox[6487:60b] __NSCFConstantString foo contains <>, hash 519204735, retain -1 | |
2012-02-12 19:40:32.661 SandBox[6487:60b] __NSCFConstantString bar contains <>, hash 516794616, retain -1 | |
2012-02-12 19:40:32.662 SandBox[6487:60b] __NSCFConstantString baz contains <>, hash 516794688, retain -1 | |
2012-02-12 19:40:32.662 SandBox[6487:60b] __NSCFString bax contains <18cbab75 ff7f0000 ad070000 01000000 70841600 01000000 03000000 00000000 20000000 00000000 00020000 00000000 00000000 00000000 00000000 00000000>, hash 516794670, retain 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment