如何在创建它的方法之外挂起以下结构?我一直在尝试将其分配给实例变量或属性,但运气不佳。
@property(nonatomic) CTParagraphStyleSetting defaultParagraphSettings;
- (void)someMethod {
CTParagraphStyleSetting settings[] = {
{ kCTParagraphStyleSpecifierAlignment, sizeof(CTTextAlignment), &alignment },
{ kCTParagraphStyleSpecifierLineBreakMode, sizeof(CTLineBreakMode), &lineBreakMode },
};
self.defaultParagraphSettings = settings;
}
self.defaultParagraphSettings = settings;
生成以下错误:
从不兼容的类型“CTParagraphStyleSetting [4]”分配给“CTParagraphStyleSetting”(又名“struct CTParagraphStyleSetting”)
我会以正确的方式解决这个问题吗?