I am using attributedText
property of label
to render html.
It is working fine with rendering bold and italic. However when i try to render html line breaks it just cuts off all the text appearing after the line break.
NSString* view = @"<i>Testing</i> and this is <b>bold</b> <br> This should be in next line";
NSDictionary *options = @{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType};
NSAttributedString *preview = [[NSAttributedString alloc] initWithData:[view dataUsingEncoding:NSUTF8StringEncoding] options:options documentAttributes:nil error:nil];
self.labelView.attributedText = preview;
Help is required
` with `
`? I think `
` is the proper XHTML tag for line breaks. – Zhang Nov 06 '14 at 07:02