Here's some sample code:
这是一些示例代码:
@interface Foo : NSObject
{
CFAttributedStringRef m_foo;
}
@property (nonatomic, assign) CFAttributedStringRef foo;
@end
@implementation Foo
@synthesize foo = m_foo;
- (id)initWithAttributedString:(CFAttributedStringRef)attributedString
{
self = [super init];
if (self == nil)
return nil;
if (attributedString != NULL)
{
self.foo = CFAttributedStringCreateCopy(NULL, attributedString);
}
return self;
}
- (void)dealloc
{
if (self.foo != NULL)
CFRelease(self.foo);
[super dealloc];
}
@end
@interfa