您的位置:首页 > 编程语言 > C语言/C++

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

2017-02-06 14:55 453 查看
代码如下

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐