XCode hangs every time when i write few lines of code in playground - objective-c

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;
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.
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.
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 :( -> :)

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.

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.

Related

XCode 6.1crash on run project

I upgraded XCode to versin 6.1 (6A1052d) and now my project crash when i try to run it on simulator.
Doesn't happen all times. The pattern seams to be after i made code changes.
No exception is throw, the XCode just restart as nothing happened.
It's running on Yosemite 10.10.
I already try:
change the computer language to english U.S and region to U.S, which was recommended to fix a similar problem in a early version.
recreated the project. Project has both Swift and objective-c, shouldn't matter but anyway...
find info on xcode logs. No logs are generated at library\logs when this happens. Any place where i can find xcode logs?
This is odd, i don't believe that xCode release its so buggy that don't run properly, so must be something less usual in settings or in project that testers missed, but have no clue of what.
fwiw, I found that this issue doesn't happen if I use the cmd-R hotkey instead of clicking the Play button.
I can also verify that this isn't a crash. It's as if the Close Workspace command is being invoked at the wrong time. Definitely a defect though.
I'm on Yosemite 10.10.1 running the latest Xcode 6.1.1. The project was upgraded from Xcode 5.1.1 where it continues to work fine. Not using Swift. US English. Pretty standard install.

Xcode builds on Debug but not on Release

So, I have this problem when trying to build my project.
Currently If I run the project in Debug mode, it runs fine, the app starts up on the device and I can test stuff.
However the weird part is when i switch over to the Release build and try to build on the device. When I press the Run button Xcode builds as normal and the build succeeded notification even pops up, but then I get this error code.
Lets call my app xxx
Could not launch "xxx.app"
No such file or directory:
/Users/*my Name*/Library/Developer/Xcode/DerivedData/*Bunch of xcode folders*/Products/Release-iphoneos/xxx.app/xxx
I went into finder and searched up xxx.app and couldn't find it. Furthermore there doesn't even exist a Library folder under /Users/my Name/.
So what is xcode trying to do here, and what should I do to fix this?
Edit: I have also tried Cleaning the project and building again, the error code still comes up.
I get this crap all the time.
What I do is clean the project, close it, shut down Xcode, start up Xcode, open project, then build and run.
If that still does not work then find the "DerivedData' folder Organizer->Projects and delete it, then do the above again and try again.
I tried creating a new scheme and setting it to Release mode. That worked for me. However, a reboot after closing xCode seems to work, too.
I went into finder and searched up xxx.app and couldn't find it. Furthermore there doesn't even exist a Library folder under /Users/my Name/.
It does exist, but it's hidden (since OSX Lion) in the Finder (because standard users -- as opposed to developers -- should not mess with it).
Some utilities (on a simple command line) can make it visible again but the simplest thing to do is to use "Go" menu of the Finder and select "Go to folder…" (Command-Shift-G). Then copy/paste the path you want to go to and validate.

GenerateDSYMFile: dsymutil fails with exit code 11

I upgraded from MacOS X 10.6 (Snow Leopard) to 10.7 (Lion) this morning, and also from Xcode 4.2 to Xcode 4.3.2. Perhaps more importantly, that means that I'm now building my project against the iOS 5.1 SDK instead of 5.0. That's a lot of changes, and one of them caused my project to break: the project will no longer build due to the following error:
Command /Applications/Xcode.app/Contents/Developer/usr/bin/dsymutil
failed with exit code 11
The full command given in the build results is as follows (full disclosure: I've changed the project name to 'MyProject' to protect the innocent):
GenerateDSYMFile /Users/caleb/xcode-build/MyProject-fmkmldxfmhvmoicxrcsqsptzuvjs/Build/Products/Debug-iphoneos/MyProject.app.dSYM /Users/caleb/xcode-build/MyProject-fmkmldxfmhvmoicxrcsqsptzuvjs/Build/Products/Debug-iphoneos/MyProject.app/MyProject
cd /Users/caleb/MyProject/iphone
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/usr/bin/dsymutil /Users/caleb/xcode-build/MyProject-fmkmldxfmhvmoicxrcsqsptzuvjs/Build/Products/Debug-iphoneos/MyProject.app/MyProject -o /Users/caleb/xcode-build/MyProject-fmkmldxfmhvmoicxrcsqsptzuvjs/Build/Products/Debug-iphoneos/MyProject.app.dSYM
This only happens when I try to build for an iOS device; building for the simulator works fine.
I've done quite a bit of searching to find an explanation of this error, but haven't found anything yet that explains the error. I did find one SO question about the same error, caused in that case by a bad tag in an Info.plist file, but my Info.plist looks fine. Another question suggests creating a new target and copying everything over. I haven't tried that yet as my project is quite large, but it's looking like the best next step.
Can anyone tell me what "exit code 11" from dsymutil means and how to fix it?
Update: Running the dsymutil command at the command line shows that exit code 11 is a segmentation fault. Still don't know what causes it, though.
A workaround that's working for me so far is to change the Debug Information Format setting in the project from "DWARF with dsym" to plain old "DWARF".
This at least lets me build the project for iOS devices and debug, so that's a very good start. I'm not sure what we lose by leaving out dsym, so I'm going to keep looking.
Update: Apple DTS suggests reinstalling Xcode. I haven't been able to try that yet, but will update this answer if it's helpful.
For future users who come here via Google :
It happened to me because my working directory was full.
EDIT:
Clear Some Space in your disk.
P.S. You can always go ahead and delete everything residing in this directory if you have developed so many apps till date on the same machine. /Users/<username>/Library/Developer/Xcode/DerivedData
P.P.S: Don't forget to check the size of the directory to get surprised. It may take upto 4 hours deleting the entire path, so do it in free time, just delete 2-3 sub directories and resume your work.
Changing "iOS Deployment Target" from 6.1 to 4.0 helped me !
have you made sure that your project build settings, compiler version is set to system default?

Xcode 4.01 - Sqlite error when trying to copy database

I am experiencing an error when running my project in xcode4.
A couple of times it stopped when it was trying to copy the database to the build directory, telling me the sqlite-file isn't there. After restarting my Mac it now stops in the build process. The text above the info-progress bar tells me "attaching to [project]".
This doesnt happen when running my project with Xcode 3.2.6.
Does anybody know a workaround for this?
Thank you very much in advance.
best regards
Tom
Apparently Xcode is a bit more serious about what's really within the xcode-project, not just laying in the directory. The error means I forgot to add the file in the directory to the project again after I mucked around with it.
Now that the file was added to the project everything is working again.
I hope it saves a bit of time in case somebody else comes accross the same problem.

Refactoring Problem XCode 4.0.1

So i was trying to refactor the name of a class in XCode following the steps in my text book. I'm sure I'm doing everything right and I downloaded XCode off the App Store. Basically, whenever I right-click -> refactor -> name -> preview, xcode crashes. Here's the error:
ASSERTION FAILURE in /SourceCache/DVTFoundation/DVTFoundation-227/Framework/Classes/Utilities/DVTTask.m:208
Details: The launch path must be set before launching.
Object:
Method: -launchRunningTerminationHandlerOnQueue:error:terminationHandler:
Thread: {name = (null), num = 15}
Hints: None
Any Ideas?
Thanks
P.S., sorry, i dont know how to using the quotes
EDIT: Fixed. I reinstalled with the package in side resources under "Show Package Contents" -> Resources -> XCODE and IOS SDK
If Xcode itself crashes, that's a bug in Xcode and you should report it. Using the Refactor command to rename a class definitely works at least some of the time -- I just tried it twice with Xcode 4.0.1 and the preview comes up with no problem.
I'd suggest creating a new project and trying the Refactor command there. If it works and doesn't crash, then your existing project may have something to do with the problem. If it doesn't work, that might suggest that the problem is related to your Xcode installation or machine configuration. This is just an attempt to help you find a way to work around the issue, though... Again, if Xcode is crashing, then there's a problem in Xcode.
Workaround:
Quit and restart Xcode before every attempt to use 'Refactor'.
For me on Lion running Xcode 4.4.1, a Refactor causes a crash every time if I've been doing any work. Even the simplest 'Rename' operation results in a crash.
If I restart Xcode, and make my first operation a 'Refactor', it works every time.
Further tip: It's a good time to make a backup, while quit before running a Refactor.