我正在使用以下细节生成PDF,在仪器中我遇到内存泄漏,任何人都可以知道为什么仪器指向CTFontRef
到100 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])];
答案 0 :(得分:1)
试试这个(假设ARC):
[string addAttribute:(NSString *)kCTFontAttributeName
value:CFBridgingRelease(helveticaBold)
range:NSMakeRange(0, [string length])];