XCode hangs every time when i write few lines of c

2019-05-30 15:14发布

问题:

I have just started working with Swish after buying my new imac and i am working on play ground. 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. I have to quit by force every time when xcode hangs.

I tried all possible option which i could find on stackoverflow;

  1. I draged xcode from application to trash bin, cleaned trash bin, restarted the imac, downloaded xcode from app store installed it. when i opened xcode after installation, it opened all my files automatically and problem was still there.

  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. It cleaned all files and folder. I restarted my system and installed xcode again :( and problem is still there.

  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: command not found

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.

Can any one turn my face from :( -> :)

回答1:

Here is a solution which @user3344236 provids. 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.

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.



回答2:

A little late, but I have run into similar problems with the latest XCode (7.2) on Yoesmite. 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.