I have found several crash reports with the reason unexpected start state
. My code looks like this:
NSRange range = [content rangeOfString:@"<html>"];
if (range.location != NSNotFound) {
NSString *htmlStr = [content substringFromIndex:range.location];
NSAttributedString *attStr = [[NSAttributedString alloc] initWithData:[htmlStr dataUsingEncoding:NSUnicodeStringEncoding] options:@{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType} documentAttributes:nil error:nil];
return attStr.string;
}
The crash report looks like this: