Refactoring Problem XCode 4.0.1 - objective-c

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.

Related

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. 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.

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.

Xcode 4.2 not running my app after rebuilding MacBook (Snow Leopard)

I recently had the MacBook I'm using to develop an app (for work) rebuilt. Xcode failed to launch and there were a number of issues when running 'verify permissions' on the disk. I copied the project to a USB stick and prepared to have the machine re-imaged. Now I have it back, I've re-installed Xcode, copied my project over and it opens - great. I started some alterations to the storyboard and tried to run it in the simulator, at which point it seems to crash and returns me to the Xcode window, debugger running.
I've tried to step through the 'problems' but I can't find anything wrong. This was a working, simple project (based entirely on a storyboard approach, very little code yet as I've been building an interface that was acceptable) and the storyboard still opens fine, all the segue's seem intact etc. It just won't run. I've tried it on another MacBook (running Lion) and it also failed, complaining about 'NSBundle' and 'MainStoryboard' (I'm sorry, that machine is at home and I don't have the exact message) - yet for all intents and purposes looked fine.
The build settings etc all verify and it builds with no issues. The app is stored in a different location on the disk to where it was originally, so perhaps some of that information is stored somewhere and needs to be reset? I've tried this: XCode 4.2 MainStoryBoard Not Found with no change.
Short of me scrapping this and starting afresh, is there anything I can do/try to salvage it? It's not a huge amount of work (probably a day or so, mainly adding text/images to the views) but I'd like to try and save it, hopefully understand a bit more of what's happened? Short of thinking the drive was corrupted and also corrupted the project somehow before I made the backup I'm at a loss.
Any pointers appreciated!
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'MainStoryboard' in bundle NSBundle </Users/appdev/Library/Application Support/iPhone Simulator/5.0/Applications/82547437-7BE3-4960-B755-84E0A999A881/testApp.app> (loaded)'
*** First throw call stack:
(0x13be052 0x154fd0a 0x439352 0x151c9 0x15461 0x147c0 0x23743 0x241f8 0x17aa9 0x12a8fa9 0x13921c5 0x12f7022 0x12f590a 0x12f4db4 0x12f4ccb 0x142a7 0x15a9b 0x208d 0x1ff5)
terminate called throwing an exception(lldb)
The storyboard file doesn't seem to be getting put into your application bundle. Select it in the project navigator in the left-hand panel, and check that there is stick against the target in the file inspector in the right-hand panel.
Also, it sounds like you are not using version control. Use version control! If you had been using version control, you wouldn't have had to worry about moving the files from computer to computer, you could roll back to a working version, and you could easily see what the differences are between the old working version and the new broken version.
check the following settings in the xcode: and make sure to clean before building the app and running.
http://postimage.org/image/nk91mrlt9/
http://postimage.org/image/i3kd4zbqv/

Xcode Internal error and no project opens

Im on 10.6 and using xcode 3.2.6. On xcode launch (however i launch) i get an xcode "internal error' popup telling me:
File: /SourceCache/DevToolsBase/DevToolsBase-1809/XcodeFoundation/Specifications/XCSpecification.m
Line: 448
Object:
Method: registerSpecificationProxiesFromPropertyListsInDirectory:recursively:inDomain:inBundle:
path should be a string, but it is nil
I can 'quit' or 'continue'. Continue launches xcode. The problem is that once open if i double click an .xcodeproj - nothing happens within xcode. To open a project I have to manually go file->open and navigate to the file.
Google gives a couple of similar issues - including this one
http://lists.apple.com/archives/mac-games-dev/2011/Mar/threads.html#00001
And i've tried everything i can think of with no joy, (Including down grading to the xcode on the OS DVD).
It looks like it can be an issue with whatever particular version of Xcode that you have running. It might be a good idea to get the latest and greatest to see if it's an issue with the Xcode software itself.
I was just hitting this and fixed it by removing a dead symlink at:
~/Library/Application Support/Developer/Shared/Xcode/Plug-ins
This thread tipped me off (although it wasn't Airplay in my case).