iOS 报错 NSLayoutTreeLineFragmentRectForGlyphAtIndex invalid glyph index ** libc++abi.dylib: terminat
来源:互联网 发布:便携式医用冷藏箱知乎 编辑:程序博客网 时间:2024/06/07 09:34
今天设置UITextView的字数限制 在UITextViewDelegate的 - (void)textViewDidChange:(UITextView *)textView回调方法里操作报错
_NSLayoutTreeLineFragmentRectForGlyphAtIndex invalid glyph index 141
libc++abi.dylib: terminate_handler unexpectedly threw an exception
错误的做法:
- (void)textViewDidChange:(UITextView *)textView
{
//评论字数不能超过140个
if (comment.length >kMaxLength) {
textView.text = [textView.text substringToIndex:kMaxLength];
}
}
正确的做法,操作UI要在主线程里面
- (void)textViewDidChange:(UITextView *)textView
{
// 评论字数不能超过140个
if (comment.length > kMaxLength) {
dispatch_async(dispatch_get_main_queue(), ^{
textView.text = [textView.text substringToIndex:kMaxLength];
});
}
}
0 0
- iOS 报错 NSLayoutTreeLineFragmentRectForGlyphAtIndex invalid glyph index ** libc++abi.dylib: terminat
- iOS 报错:!!! _NSLayoutTreeLineFragmentRectForGlyphAtIndex invalid glyph index libc++abi.dylib: termi
- 解决iOS报错libc++abi.dylib handler threw exception
- 解决iOS报错libc++abi.dylib handler threw exception
- 解决iOS报错libc++abi.dylib handler threw exception
- 解决iOS报错libc++abi.dylib handler threw exception
- iOS报错libc++abi.dylib handler threw exception
- 解决iOS报错libc++abi.dylib handler threw exception
- iOS报错libc++abi.dylib handler threw exception
- 解决iOS报错libc++abi.dylib handler threw exception
- 解决iOS报错libc++abi.dylib handler threw exception
- 解决iOS报错libc++abi.dylib handler threw exception
- libc++abi.dylib: terminate_handler unexpectedly threw an exception 报错
- iOS中遇到libc++abi.dylib`__cxa_throw:
- libc++abi.dylib`__cxa_throw:
- libc++abi.dylib`__cxa_throw:
- 解决报错libc++abi.dylib: terminate_handler unexpectedly threw an exception
- 解决iOS的libc++abi.dylib: handler threw exception问题
- 最近捣腾的-xwiki, java cpu负载监控
- java profile【cpu负载过高】
- [构建高性能web站点]-笔记1绪论
- ThreadPoolExecutor的应用和实现分析(中)—— 任务处理相关源码分析
- [构建高性能web站点]-2实际案例
- iOS 报错 NSLayoutTreeLineFragmentRectForGlyphAtIndex invalid glyph index ** libc++abi.dylib: terminat
- [bugfix]重新理解Thread的InterruptedException
- 五一杂谈
- 恐怖的string+操作消耗
- 出现( linker command failed with exit code 1)错误总结
- Python的函数返回值
- 【bugfix】纠正博文'扩展log4j系列[二]动态、分文件记log'
- dp
- 近期语录