首页 > 编程 > C++ > 正文

libc++abi.dylib: terminate_handler unexpectedly threw an exception修复

2019-11-09 17:43:41
字体:
来源:转载
供稿:网友

代码如下

NSMutableAttributedString *attributedString1 = [[NSMutableAttributedString alloc]initWithString:Label.text];[attributedString1 addAttribute:NSForegroundColorAttributeName value:BuleTextColor range:NSMakeRange(0,20)];Label.attributedText = attributedString1;

真机运行后全局断点断在了 [attributedString1 addAttribute:NSForegroundColorAttributeName value:BuleTextColor range:NSMakeRange(0,20)];这句代码

报错原因是:range长度越界 解决办法:检查Label.text的长度是否达到20


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选