iOS 系统crash探寻之路
来源:互联网 发布:不亦说乎 不亦悦乎 编辑:程序博客网 时间:2024/05/22 07:08
解决方案: 直接网上查到资料
http://stackoverflow.com/questions/19948394/textviewdidchange-crashes-in-ios-7
What's happening is that you're typing what is referred to as multistage text input, i.e. the input has to be confirmed from the user before it's actually committed into the underlying text. You get the crash because the text is only kind-of inputted, and until the text has been committed, it could easily change to something else.
To detect this situation, you're looking for the markedTextRange
property of the UITextView, which indicates if you're in this complex input mode.
If the property is non-nil, then you're in this special input mode, so you should guard your modification code with something like:
if (self.tv.markedTextRange == nil && self.tv.text.length > maxLength) { // Perform change}
Near as I can tell the crash is triggered by the special multistage text input mode, so you should avoid changing the text while this mode is active.
复杂输入法模式时做一下以上的保护就可以了- iOS 系统crash探寻之路
- WebP 探寻之路
- WebP 探寻之路
- WebP 探寻之路
- WebP 探寻之路
- WebP 探寻之路
- WebP 探寻之路
- WebP 探寻之路
- WebP 探寻之路
- IOS crash之NSInvalidArgumentException
- iOS Crash之NSInvalidArgumentException
- iOS Crash之NSMallocException
- iOS Crash之NSFileHandleOperationException
- iOS Crash之NSRangeException
- iOS Crash之NSGenericException
- iOS Crash之NSInternalInconsistencyException
- 企业探寻IM之路
- 探寻产品化之路
- AngularJS的 $on、$emit和$broadcast使用
- 写作技巧
- ios7毛玻璃效果实现
- 《unix高级环境编程》系统数据文件和信息——口令文件
- Java异常及处理方法
- iOS 系统crash探寻之路
- 手机摇一摇 DeviceOrientationEvent
- 自动化测试工具和框架简介
- 机器学习_贝叶斯网络分类算法
- Python 发送邮件
- Java Socket网络编程
- UVA - 111 History Grading
- web服务器模拟实现
- delphi——常用问题与解决方法