【发布时间】:2012-11-09 02:02:03
【问题描述】:
谁能告诉我如何避免将图像粘贴到 UITextView 中导致的崩溃?
我的应用中有 UITextView,它允许对属性文本进行一些基本的编辑(iOS 6)。用户发现他们可以从网页复制文本和图像的组合,然后切换到我的应用程序并使用 UITextView 菜单 > 粘贴命令,这会使应用程序崩溃。我可以重现它,但我很难过如何处理它。崩溃的日志如下所示:
*** Assertion failure in -[NSHTMLReader _addAttachmentForElement:URL:needsParagraph:usePlaceholder:], /SourceCache/UIFoundation_Sim/UIFoundation-78/UIFoundation/TextSystem/NSHTMLReader.m:1478
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unable to find missing_image.tiff!'
当用户在另一个应用程序中使用复制命令时,我无法阻止他们选择图像。我也不想禁止在我的应用中粘贴。
【问题讨论】:
标签: ios crash uitextview copy-paste paste