如何清除 iPhone 模拟器复制和删除粘贴剪贴板?
我正在调试剪贴板为空时发生的缺陷(可以看到弹出三角形而没有弹出窗口,可能是系统缺陷)。作为检查缺陷的一部分,我在剪贴板上复制了一些内容,现在需要清除它...但是如何呢?
关闭模拟器并重新启动并没有清除剪贴板。不得不说,不能完成这样一个“简单”的任务是非常有趣的:)
在有人建议之前,复制空格或其他空白字符是不够的。我需要它是空的,而不仅仅是不可见的。
I was debugging a defect which occurs, when clipboard is empty (could see popup triangle without popup, possibly system defect). As part of examining the defect I copied something on clipboard and now would need to clear it... but how?
Shutting down simulator and restarting did not clear clipboard. Have to say it's pretty funny not to be able to do such a "simple" task :)
Before anyone suggests, copying space or some other whitespace character will not be enough. I need it to be empty, not just non-visible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以将模拟器重置为“出厂默认设置”。
单击菜单栏中的“iOS Simulator”,然后选择顶部的第三个选项。
You can reset the simulator to "factory defaults".
Click on "iOS Simulator" in the menu bar and select the third option from the top.
这类似于复制空白,但更有效(并且比 The-Kenny 的解决方案破坏性更小)。您可以将空字符串粘贴到剪贴板,例如:
一旦您的程序运行了这行代码,“粘贴”选项将不再出现在弹出的三角形菜单中。我在测试我的代码时一直在使用这种确切的方法,并且效果很好。祝你好运。
This is similar to copying whitespace, but more effective (and less destructive than The-Kenny's solution). You can paste an empty string to the clipboard, something like:
Once your program runs this line of code, the "Paste" option will no longer appear in the pop up triangle menu. I have been using this exact method while testing my code, and it works great. Good Luck.
最好的解决方案是简单地将需要修复的代码之前的文本、图像或其他内容设置为 NULL。这将完全清除粘贴板。
The best solution is to simply set the text, image or whatever, to NULL before the code that you need to fix. This clears the pasteboard completely.