简体   繁体   English

每当我在操场上写几行代码时,XCode都会挂起

[英]XCode hangs every time when i write few lines of code in playground

I have just started working with Swish after buying my new imac and i am working on play ground. 买完新的imac之后,我才开始与Swish合作,而且我正在操场上工作。 for last 2 days i am banging my head with wall but i could not fix this problem. 在过去的两天里,我用墙壁砸了我的头,但我无法解决此问题。

When ever i am writing few lines of code, Xcode hangs and mouse turns into small colored circle when you hoverover on the xcode window. 每当我编写几行代码时,当您将鼠标悬停在xcode窗口上时,Xcode就会挂起,并且鼠标会变成彩色的小圆圈。 I have to quit by force every time when xcode hangs. 每当xcode挂起时,我都必须强制退出。

I tried all possible option which i could find on stackoverflow; 我尝试了所有可能在stackoverflow上找到的选项;

  1. I draged xcode from application to trash bin, cleaned trash bin, restarted the imac, downloaded xcode from app store installed it. 我将xcode从应用程序拖到垃圾桶,清理了垃圾桶,重新启动了imac,并从应用商店下载了xcode并安装了它。 when i opened xcode after installation, it opened all my files automatically and problem was still there. 当我在安装后打开xcode时,它会自动打开所有文件,问题仍然存在。

  2. Then i followed this solution How to uninstall Xcode 5.0.2 from MAC 10.9 and removed all xcode related files by using appCleaner. 然后,我按照以下解决方案操作: 如何从mac 10.9卸载Xcode 5.0.2,并使用appCleaner删除所有与xcode相关的文件。 It cleaned all files and folder. 它清除了所有文件和文件夹。 I restarted my system and installed xcode again :( and problem is still there. 我重新启动系统并再次安装了xcode :(并且问题仍然存在。

  3. I tried to uninstall xcode with sudo /Developer/Library/uninstall-devtools --mode=all but it does not work, terminal says 我尝试使用sudo /Developer/Library/uninstall-devtools --mode=all卸载xcode,但它不起作用,终端说

    sudo: /Developer/Library/uninstall-devtools: command not found sudo:/ Developer / Library / uninstall-devtools:找不到命令

I could see that there is something wrong with this run time compiler. 我可以看到此运行时编译器有问题。

and yes i downloaded and installed the xcode 6.4 beta version and problem still there. 是的,我下载并安装了xcode 6.4 beta版本,问题仍然存在。

Can any one turn my face from :( -> :) 任何人都可以从:(-> :)转向我的脸

Here is a solution which @user3344236 provids. 这是@ user3344236提供的解决方案。 If someone has same problem use this trick. 如果有人遇到相同的问题,请使用此技巧。 Create an empty project and then add playgrounds file in it. 创建一个空项目,然后在其中添加游乐场文件。 It would not crash or Xcode would not hang. 它不会崩溃或Xcode不会挂起。

Playground is in early stages and there is something fishy with "standalone" playground, If you create swift file with File->New->PlayGround, there is high chances that Xcode will hang and you can have same problem what i had for 2 days. 游乐场处于早期阶段,“独立”游乐场有些混乱,如果使用File-> New-> PlayGround创建swift文件,则Xcode很有可能会挂起,并且您可能会遇到同样的问题,持续了两天。

A little late, but I have run into similar problems with the latest XCode (7.2) on Yoesmite. 有点晚了,但是我在Yoesmite上使用最新的XCode(7.2)遇到了类似的问题。 This is espcially annoying when you are, for example, writing up a long tutorial in the editor and risk losing content because of a Force Quit situation. 例如,当您在编辑器中写了一个很长的教程并由于强制退出的情况而冒着丢失内容的风险时,这尤其令人讨厌。

The simplest workaround I have found, especially when I am initially entering all the text and code (and hence really don't want it continuously trying to execute) is to insert the following at the top of each new file - removing it when I am ready to autorun the code. 我找到的最简单的解决方法,尤其是当我最初输入所有文本和代码(因此确实不希望其不断尝试执行)时,是在每个新文件的顶部插入以下内容-当我进入时将其删除准备自动运行代码。

don't execute

It can be any text, as long as it doesn't parse. 只要不解析,它可以是任何文本。 The playground environment won't try to run while there is a syntax error in the file. 当文件中存在语法错误时,游乐场环境将不会尝试运行。 But you still get all the context-sensitive help and auto-completion magic to aid in your writing. 但是您仍然可以获得所有上下文相关的帮助和自动完成魔术,以帮助您进行写作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM