Reputation: 593
I am generating a PDF using the below detail , in Instrument i am getting memory leak, can any one have idea why the instruments point to the CTFontRef
to 100 perc leak.?
NSMutableAttributedString *string = [[[NSMutableAttributedString alloc]
initWithString:textToDraw] autorelease];
CTFontRef helveticaBold = CTFontCreateWithName(CFSTR("Helvetica-Bold"), 8.0, NULL);
[string addAttribute:(id)kCTFontAttributeName
value:(id)helveticaBold
range:NSMakeRange(0, [string length])];
Upvotes: 0
Views: 380
Reputation: 3258
Try this (assuming ARC):
[string addAttribute:(NSString *)kCTFontAttributeName
value:CFBridgingRelease(helveticaBold)
range:NSMakeRange(0, [string length])];
Upvotes: 1