iOS崩溃报告"意外启动状态"例外?

时间:2017-10-23 03:08:04

标签: ios crash nsmutableattributedstring nsexception

我找到了几个崩溃报告,原因为unexpected start state。我的代码如下所示:

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;
}

崩溃报告如下所示:

enter image description here

1 个答案:

答案 0 :(得分:0)

只需在后台线程中调用您的函数即可:

df1 = (pd.wide_to_long(df, stubnames=['FA','TA','OR'], j='p', i='ID', sep='_')
         .reset_index(level=1, drop=True)
         .sort_index())
print (df1)
      FA   TA   OR
ID                
ID1  590  313  671
ID1  304  682  499
ID2  832  482  580
ID2  344  223  789
ID3  598  125  775
ID3  138  712  761