Ios EXC\u错误\u访问内核\u无效\u地址Firebase crashlytics检测NSAttributed字符串格式崩溃
Firebase crashlytics检测到崩溃,但我无法检测到。但是在超过100多次重新加载我的主页后,我产生了崩溃。是否有任何与时间相关的问题 从LatestFootballNews和VideosViewController,我调用GetHtmLatAttributedStringLight函数,并尝试将返回值赋给一个UIable(self.type3.attributedText=attributedString;)。但我最新的足球新闻和视频查看控制器从SuperView中删除了3次或更多次。我在这里测量,有什么问题吗 最新足球新闻和视频视频视频控制器.mIos EXC\u错误\u访问内核\u无效\u地址Firebase crashlytics检测NSAttributed字符串格式崩溃,ios,objective-c,Ios,Objective C,Firebase crashlytics检测到崩溃,但我无法检测到。但是在超过100多次重新加载我的主页后,我产生了崩溃。是否有任何与时间相关的问题 从LatestFootballNews和VideosViewController,我调用GetHtmLatAttributedStringLight函数,并尝试将返回值赋给一个UIable(self.type3.attributedText=attributedString;)。但我最新的足球新闻和视频查看控制器从SuperView中删除了3次或更
dispatch_async(dispatch_get_main_queue(), ^{
@try {
NSAttributedString *attributedString=[GlobalVariable getHtmlAttributedStringLight:description fontName:@"Oswald-Regular" fontSize:20 textAlign:@"left" colorStr:@"#555555"];
self.type3.attributedText=attributedString;
}@catch (NSException * e) {
NSLog(@"NSAttributedString converting error");
}
});
全局变量
+(NSAttributedString*)getHtmlAttributedStringLight:(NSString*)value fontName:(NSString*)fontName fontSize:(int)fontSize textAlign: (NSString*)textAlign colorStr:(NSString*)colorStr {
@try {
if(value!=nil && ![value isKindOfClass:[NSNull class]]){
return [[NSAttributedString alloc] initWithData:[[NSString stringWithFormat:@"<span style=\"font-family: %@; font-size: %dpx; text- align: %@; color: %@;\">%@</span>",fontName, fontSize, textAlign, colorStr, value] dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil];
}else{
return [[NSAttributedString alloc] init];
}
}@catch (NSException * e) {
return [[NSAttributedString alloc] init];
}
}
你的字体存在吗?是的,字体已经存在。这里的名字是:Oswald-Regular.ttf。我在这里使用它作为style=“font-family:Oswald-Regular;”崩溃是随机的还是常规的?为什么要调用try-in-try?崩溃是随机的,我无法生成此崩溃。首先,我从firebase观察它。起初,我的代码中没有try块。但是为了解决这个问题,我已经试了很多次了。但是每次我都失败了。@AMIT你有没有找到解决办法,因为我面临同样的问题?你的字体存在吗?是的,字体已经存在了。这里的名字是:Oswald-Regular.ttf。我在这里使用它作为style=“font-family:Oswald-Regular;”崩溃是随机的还是常规的?为什么要调用try-in-try?崩溃是随机的,我无法生成此崩溃。首先,我从firebase观察它。起初,我的代码中没有try块。但是为了解决这个问题,我已经试了很多次了。但是每次我都失败了。@AMIT你有没有找到解决办法,因为我面临着同样的问题?
-(void)loadAll {
__weak LatestFootballNewsAndVideosViewController *weakSelf = self; weakSelf.type3.attributedText=attributedString;
}