下面是我的代码崩溃
CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString(currentText);
Run Code Online (Sandbox Code Playgroud)
我想设置字体请帮帮我谢谢.
+(void)drawText:(NSString*)textToDraw inFrame:(CGRect)frameRect
{
// CFStringRef stringRef = (__bridge CFStringRef)textToDraw;
// Prepare the text using a Core Text Framesetter
NSAttributedString *stringRef=[[[NSAttributedString alloc]initWithString:textToDraw attributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont boldSystemFontOfSize:12.0],(NSString*)kCTFontAttributeName, nil]]autorelease];
CFAttributedStringRef currentText =(__bridge CFAttributedStringRef)stringRef;
CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString(currentText);// at this Line it giving me EXC_BAD_ACCESS
CGMutablePathRef framePath = CGPathCreateMutable();
CGPathAddRect(framePath, NULL, frameRect);
CFRange currentRange = CFRangeMake(0, 0);
CTFrameRef frameRef = CTFramesetterCreateFrame(framesetter, currentRange, framePath, NULL);
CGPathRelease(framePath);
CGContextRef currentContext = UIGraphicsGetCurrentContext();
CGContextSetTextMatrix(currentContext, CGAffineTransformIdentity);
CGContextTranslateCTM(currentContext, 0, frameRect.origin.y*2);
CGContextScaleCTM(currentContext, 1.0, -1.0);
CTFrameDraw(frameRef, currentContext); …Run Code Online (Sandbox Code Playgroud) INSERT OR REPLACE INTO如果该行已存在,则SQLite语句将替换该行.但是当我一次又一次地运行相同的语句时,它会继续插入而不是替换.
在什么情况下REPLACE实际发生?
INSERT OR REPLACE INTO names (rollno, name) VALUES (1, "Adam")
Run Code Online (Sandbox Code Playgroud) 对不起,如果问题是愚蠢的,而不是使用[mytableview reloaddata],我们如何重新加载只有特定的数据UITableViewCell.