Created
August 29, 2014 02:51
-
-
Save Neo-J/d42f5c2a03d257eba3bf to your computer and use it in GitHub Desktop.
使用NSAttributedString创建html字符串
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSAttributedString *attrString; // from previous code | |
NSDictionary *options = @{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType}; | |
NSData *htmlData = [attrString dataFromRange:NSMakeRange(0, [attrString length]) documentAttributes:options error:nil]; | |
NSString *htmlString = [[NSString alloc] initWithData:htmlData encoding:NSUTF8StringEncoding]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment