在我的 iOS 应用程序中,如何在 NSString 值中使用粗体?我使用下面的代码在 NSString 值中制作粗体文本,但显示错误
像这样:
架构 i386 的未定义符号:“_kCIAttributeName”,
NSString *boldFontName = [[UIFont boldSystemFontOfSize:12] fontName];
NSString *yourString = [NSString stringWithFormat:@"%@%@%@",key,@":",@" "];
NSRange boldedRange = NSMakeRange(22, 4);
NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:yourString];
[attrString beginEditing];
[attrString addAttribute:kCIAttributeName value:boldFontName range:boldedRange];
[attrString endEditing];
NSString *string = [NSString stringWithFormat:@"%@%@",attrString,[dic objectForKey:key]];
如何在字符串中制作粗体字体?