@Dauh-Djan
but will it cause exc_bad_address problem on self.textFrame?
self.mAttributeString = [self fixLastLineMissBugWhenDrawWithCoreText:self.mAttributeString];
CTFramesetterRef frameSetter = CTFramesetterCreateWithAttributedString((CFAttributedStringRef)self.mAttributeString);
CGSize size = CTFramesetterSuggestFrameSizeWithConstraints(frameSetter, CFRangeMake(0, self.mAttributeString.length), NULL, CGSizeMake(self.widthLimit, CGFLOAT_MAX), NULL);
self.height = size.height + 0.5;
CGMutablePathRef path = CGPathCreateMutable();
CGPathAddRect(path, NULL, CGRectMake(0, 0, self.widthLimit, self.height));
NSUInteger length = self.mAttributeString.length;
CTFrameRef ctFrame = CTFramesetterCreateFrame(frameSetter, CFRangeMake(0, length), path, NULL);
self.ctFrame = ctFrame;
CFRelease(ctFrame);
CGPathRelease(path);
CFRelease(frameSetter);
it solve the Potential leak of an object
warning, however it will cause self.ctFrame
to an exc_bad_address problem...