Objective c NSAttributedString的属性如何从CoreText(CTFontRef,…)桥接?
我需要将项目转换为ARC Project的目标是iOS 7.0,它使用了来自CoreText的大多数属性Objective c NSAttributedString的属性如何从CoreText(CTFontRef,…)桥接?,objective-c,automatic-ref-counting,nsattributedstring,core-text,core-foundation,Objective C,Automatic Ref Counting,Nsattributedstring,Core Text,Core Foundation,我需要将项目转换为ARC Project的目标是iOS 7.0,它使用了来自CoreText的大多数属性 NSDictionary *aDic = @{(NSString*)kCTFontAttributeName: (id)ctFont, (NSString*)kCTParagraphStyleAttributeName: (id)ctParagraphStyle, (NSString*)kCTFore
NSDictionary *aDic = @{(NSString*)kCTFontAttributeName: (id)ctFont,
(NSString*)kCTParagraphStyleAttributeName: (id)ctParagraphStyle,
(NSString*)kCTForegroundColorAttributeName: (id)[UIColor red].CGColor,
(NSString*)kCTKernAttributeName: @-0.5f};
或(\uu桥id)ctFont
或(\uu桥UIFont*)ctFont
(UIFont*)CfBrigingRelease(ctFont)
或(\u桥id)ctParagraphStyle
或(\u桥NSParagraphStyle*)ctParagraphStyle
(NSParagraphStyle*)CfBridgegRelease(ctParagraphStyle)
或(\uu桥id)[UIColor red].CGColor
或(\uu桥UIColor*)[UIColor red].CGColor
(UIColor*)CfBrigingRelease([UIColor red].CGColor)
kCTKernAttributeName
,可以不加区别地接受记录的CFNumberRef
和未记录的NSNumber*
- iOS 7上的兼容性也一样吗
- CGColorRef/UIColor、CTFontRef/UIFont、CTParagraphStyleRef/NSParagraphStyle等是否具有此兼容性