the*_*124 1 objective-c ios dtcoretext
我收到错误:
-[__NSCFType lineBreakMode]: unrecognized selector sent to instance
Run Code Online (Sandbox Code Playgroud)
当以下代码完成执行时:
NSDictionary* options = @{ NSTextSizeMultiplierDocumentOption: [NSNumber numberWithFloat: 1.0],
DTDefaultFontFamily: @"Helvetica Neue",
};
NSAttributedString *attrStr = [[NSAttributedString alloc] initWithHTMLData:[@"HTML TEXT HERE" dataUsingEncoding:NSUTF8StringEncoding] options:options documentAttributes:NULL];
attrStr = [attrStr copy];
UILabel *lbl = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];
lbl.attributedText = attrStr;
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"MOTD"
message:@""
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert setValue:lbl forKey:@"accessoryView"];
[self Load_list_Data];
[alert show];
Run Code Online (Sandbox Code Playgroud)
我的项目针对的是iOS 8+.
有任何想法吗?
出于某种原因,即使我使用iOS 8强制iOS 6属性修复了问题:
NSDictionary* options = @{ NSTextSizeMultiplierDocumentOption: [NSNumber numberWithFloat: 1.0],
DTDefaultFontFamily: @"Helvetica Neue",DTUseiOS6Attributes: [NSNumber numberWithBool:YES],
};
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
757 次 |
| 最近记录: |