我的应用程序用于UITextView
从用户那里获取一些输入,我使用 Xcode4.5 模拟器来进行 Ipad 5.1 ,ARC
如果用户尝试复制和粘贴带有公告或图像的文本,我会收到以下错误:
Mapping '/Users/user/Library/Application Support/iPhone Simulator/5.1/Library/Caches/com.apple.keyboards/images/1848901318' failed: 'Cannot allocate memory' (12)
GuardMalloc[W]: Failed to VM allocate 16384 bytes
GuardMalloc[W]: Explicitly trapping into debugger!!!
我厌倦了用户以防止使用任何奇怪的字符或图像粘贴但无法使其工作,它甚至不会触发。
- (void)paste:(id)sender {
UIPasteboard *pasteBoard = [UIPasteboard generalPasteboard];
NSString *string = pasteBoard.string;
NSLog(@"Pasteboard string: %@", string);
[self.wodDescription insertText:string]; //woddesription is the textview
}
为什么我得到上述错误?解决此崩溃的最佳方法是什么?