XCode Local Changes Indicator like other IDEs - xcode

I'm new to XCode and Objective-C programming. I have used WebStorm, IntelliJ, Netbeans, and Eclipse. They all support something like this:
Notice the colors on the left that indicate what's changed locally. Clicking on those will show me what it was before and allow me to reset the local copy to what it was before. Very useful and I do it all the time.
Obviously, with iOS programming, I want to use XCode, but I really want to have those indicators. All I see with XCode is this:
Notice that there's no indicator at all...
Note: I am not talking about being able to open a git diff tool, even if it's built into XCode. I am looking for the simplicity that all the other IDEs give me...

The closest thing in Xcode is the version editor. Choose View > Version Editor > Show Version Editor to show the version editor. The version editor shows your local copy and the last committed version of the file side by side and highlights the changes between the two versions.

Related

I accidentally closed my Xcode application. How do I undo any changes?

I was testing out some new swift code. I knew that if I made any mistake I could simply revert back to my old code by pressing Command+Z.
But I accidentally closed my Xcode Editor while writing new code.
How would I undo the new changes and go back to my old original code? I did not make use of github for this.
There might be a chance you can view the file's old history. Check out George Marmaridis' answer
Here is what he says:
You might not be out of luck. Although Git can't help you, Finder may be able to come to the rescue!
If you have not turned off the Versions feature (which by default is turned on and you need a Terminal command to disable), then do the following:
Quit Xcode.
Open the file you wish to bring back your lost changes to using TextEdit.
Go to File > Revert To > Browse All Versions...
Scroll through the available versions. Hopefully you will have many available to choose from.
Select a version and hit Restore.
Follow 2-5 for all necessary files.
Launch Xcode. You should now see the M next to these files in Project Navigator indicating they include uncommited changes (the changes you previously discarded).

Xcode bug when displaying an xcodeproj

I'm currently using Xcode 7.1 and I came across this:
I'm in no case a seasoned Mac user and I'm unable to revert to the full display where I had the project's info on the center of the screen.
Does someone more experienced or less dumb than me know how I can fix this?
When I've seen this before, it's largely because of the .pbxproj file being corrupted - and this only really happens (??) if there is something that is externally modifying it, like a git merge.
In order to verify - and fix it - you need to:
a) Go to the project in Finder (and then close it in Xcode)
b) Ctrl-click it and select 'Show Package Contents'
c) open the project.pbxproj file in a text editor and finally
d) fix any information that is stopping Xcode from reading the XML structure and displaying it properly in the IDE.
With git, the error is usually unmergeable differences in the Build Settings - Teams, Profiles, Id's, etc. So you can either scroll very carefully through all 500+ lines of markup, or simply search for the git HEAD markers that look like chains of < or > lines - eg. '<<<<<<<<<<< HEAD '
Remove those, fix the conflicts, save the file, and reopen the Project.
Should be all good then!

Xcode 5 diff files that aren't in versioning system

Xcode 5 has a nice diff system. But for the life of me, I cannot get it to diff two files that aren't in a repository. I just want to use it to compare any two arbitrary files, but when I open one file, and go to the version editor button, the two half windows say: "no editor"
Any thoughts?
Choose Xcode > Open Developer Tool > FileMerge from the menu bar and you'll get an app that can show you a comparison view much like the one in the Xcode version editor.

How to make Xcode refresh the editor content?

I am developing a project with Xcode 4.1 using Subversion through Xcode's built-in source control menu and command line. When reverting/updating the source through command line, I can't get the Xcode editor to show the current version of the source files (as they appear in the Finder or any external editor). I guess this is generally the case when editing a source file with an external editor.
Eclipse would immediately warn you that the editor content is outdated (Xcode does it when you try to save the file). Then you would simply right click on the project tree to refresh the corresponding files/directories. There must be a similar feature in Xcode.
svn revert MyFile.m
will copy the old back and therefore also the old timestamp, making XCode think it is using the most recent version of the file (which is true, except that in this particular situation you would want it to use the older version again).
As a workaround you can "touch" all the reverted files, giving them a new timestamp.
touch MyFile.m
That will make XCode display the content as it is in the file and also include it in the next build iteration. This works for .h/.m files but also any project or meta data files used by XCode.
Do you mean Menue:File >> Source Control >> Refresh Status ?

XCode Editor, Debugger, Build results all in one IDE

I remember seeing it from the release notes of an earlier XCode version saying that it allows the three all in one IDE since then, instead of having to switch back and forth between the different windows when working on build, debug and editing. But with the latest XCode install, I still have to do that in separate windows. Is there a special setting to merge them all together under one IDE/window?
It's in XCode preferences, called "All in one" layout. Check this:
http://img.skitch.com/20101121-xsxhc34ywurcf14yuhm6hna5qi.png
Note that in order for that to be changed - all projects must be closed.

Resources