iOS 7上的UITextview撤消中的奇怪崩溃

 潇潇洒洒牛仔_584 发布于 2023-02-08 13:43

我收到了一堆崩溃报告,看起来很像下面这个范围的不同值.有时范围不是0-x,可以说是2-x

特定于应用程序的信息:*由于未捕获的异常终止应用程序\'NSRangeException \',原因:\'* - [NSBigMutableString substringWithRange:]:范围{0,69}超出范围; 字符串长度0 \'

Last Exception Backtrace:
0   CoreFoundation                      0x2e879e83 __exceptionPreprocess + 131
1   libobjc.A.dylib                     0x38bd66c7 objc_exception_throw + 38
2   CoreFoundation                      0x2e879dc5 +[NSException raise:format:] + 112
3   Foundation                          0x2f1a1bd1 -[NSString substringWithRange:] + 120
4   UIKit                               0x311b2815 -[NSTextStorage(UIKitUndoExtensions)     _undoRedoAttributedSubstringFromRange:] + 132
5   UIKit                               0x315d9679 -[_UITextUndoOperationTyping undoRedo] + 296
6   Foundation                          0x2f296453 -[_NSUndoStack popAndInvoke] + 250
7   Foundation                          0x2f2952ef -[NSUndoManager undoNestedGroup] + 454
8   UIKit                               0x3127a147 -[UIApplication alertView:clickedButtonAtIndex:] + 142
9   UIKit                               0x31216449 -[_UIModalItemsCoordinator _notifyDelegateModalItem:tappedButtonAtIndex:] + 144
10  UIKit                               0x3121638d -[_UIModalItemAlertContentView tableView:didSelectRowAtIndexPath:] + 1000
11  UIKit                               0x3111b0cb -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1078
12  UIKit                               0x311ce863 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 214
13  UIKit                               0x3107e781 _applyBlockToCFArrayCopiedToStack + 316
14  UIKit                               0x30ff67bb _afterCACommitHandler + 430
15  CoreFoundation                      0x2e844f69 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 20
16  CoreFoundation                      0x2e8428f7 __CFRunLoopDoObservers + 286
17  CoreFoundation                      0x2e842c43 __CFRunLoopRun + 738
18  CoreFoundation                      0x2e7ad471 CFRunLoopRunSpecific + 524
19  CoreFoundation                      0x2e7ad253 CFRunLoopRunInMode + 106
20  GraphicsServices                    0x334e72eb GSEventRunModal + 138
21  UIKit                               0x31062845 UIApplicationMain + 1136
22  MyApp                               0x00071f3b main (main.m:18)
23  libdyld.dylib                       0x390cfab7 start + 2

小智.. 13

如果在用户编辑后设置UITextView的文本属性,则似乎需要调用[textView.undoManager removeAllActions]来清除撤消历史记录.

1 个回答
  • 如果在用户编辑后设置UITextView的文本属性,则似乎需要调用[textView.undoManager removeAllActions]来清除撤消历史记录.

    2023-02-08 13:45 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有