Can anyone tell me how to avoid a crash caused by pasting an image into a UITextView?
I have UITextView in my app that allows some basic editing of attributed text (iOS 6). A user has discovered that they can copy a combination of text and images from a web page, then switch to my app and use the UITextView menu > paste command it will crash the app. I can reproduce it, but I'm stumped what to do about it. The log from the crash looks like:
*** 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!'
I can't stop users from selecting images when they use the copy command in another app. I also don't want to disallow pasting within my app.