Created
September 21, 2012 01:42
-
-
Save alanjrogers/3759329 to your computer and use it in GitHub Desktop.
__attribute(NSObject)__ test
This file contains 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> | |
@interface TestClass : NSObject | |
@property (nonatomic, strong) __attribute__((NSObject)) CFStringRef str; | |
@end | |
@implementation TestClass | |
@end | |
int main(int argc, char* argv[]) { | |
@autoreleasepool { | |
CFStringRef str = CFStringCreateWithFormat(NULL, NULL, CFSTR("%f"), 2.5); | |
TestClass *obj = [[TestClass alloc] init]; | |
obj.str = str; | |
CFRelease(str), str = NULL; | |
NSLog(@"obj.str %@", obj.str); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment