0

我正在使用以下详细信息生成 PDF,在仪器中我遇到内存泄漏,任何人都知道为什么仪器指向CTFontRef100 perc 泄漏。?

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])];
4

1 回答 1

1

试试这个(假设 ARC):

[string addAttribute:(NSString *)kCTFontAttributeName
               value:CFBridgingRelease(helveticaBold)
               range:NSMakeRange(0, [string length])];
于 2013-04-30T20:01:26.460 回答