What I need is to create NSAttributedString
objects from relatively big HTML strings and store them (NSAttributedString-s) in the database. And of course I woul
You can try NSAttributedString+DDHTML. AFAIK it doesn't depend on WebKit and I used it successfully for simple HTMLs. I haven't tried using it in the background thread, but I suppose it shouldn't be a problem.
And watch out - it may crash when HTML includes font which is unavailable on iOS. I've issued a pull request for that.
Yes you can't it in a background thread only on main thread.
Use Oliver Drobnik's NSAttributedString+HTML
class.
Code would be something like this -
NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithHTML:<html> dataUsingEncoding:NSUTF8StringEncoding] documentAttributes:nil];
Link - https://github.com/InfiniteLoopDK/NSAttributedString-Additions-for-HTML/blob/master/Classes/NSAttributedString%2BHTML.m