NSAttributedString has initWithHTML method
NSAttributedString has initWithHTML method
- Subject: NSAttributedString has initWithHTML method
- From: Darin Duphorne <email@hidden>
- Date: Wed, 23 Jan 2002 19:23:42 -0600
Wow! NSAttributedString Class Cluster Additions provides an initWithHTML
method to NSAttributedString.
Maybe this is the answer to my HTML Editor problem. But, can anyone tell
me why this crashes? It looks pretty straightforward.
@implementation controller
- (IBAction)doit:(id)sender
{
NSAttributedString *attrStr;
NSString *htmlString;
htmlString=@"<html><head></head><body><u>underlined </u><i>italics</i></body>
</html>";
[attrStr initWithHTML:[htmlString dataUsingEncoding:NSASCIIStringEncoding]
documentAttributes:NULL];
[textField lockFocus];
[attrStr drawAtPoint:NSMakePoint(0.0, 0.0)];
}
@end