Question

I have a property like this in a UIView subclass

@property(nonatomic, assign) CTTypesetterRef typesetter;

I initiate the TypeSetter in the view constructor:

- (id)initWithFrame:(CGRect)frame andAttributedString:(NSMutableAttributedString * )   pageAttributedString
{
    self = [super initWithFrame:frame];
    if (self) {
            self.attributedString = pageAttributedString;
            self.typesetter = CTTypesetterCreateWithAttributedString((CFAttributedStringRef)CFBridgingRetain(self.attributedString));
}

The question is where to release the TypeSetter using CFRelease?

I am using ARC, IOS 7 and Xcode 5

Was it helpful?

Solution

in your -dealloc like you would do with MRR.

just remember that unlike MRR, in ARC you don't have to call [super dealloc] neither do you need to explicitely call -release on your ARC managed ivars.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top