How to set up file compare/diff in Xcode 4?

Solution 1:

If you're looking for comparing two different files (instead of comparing two versions of the same file), you can use the FileMerge tool included with Xcode. Spotlight can find it for you.

Solution 2:

Richard Brightwell's answer is correct, although it threw me a bit as there is a step missing.

  1. Select the file from project navigator then click the version editor button (top right).
  2. Click the timeline icon between the two files to display a vertical bar representing the revisions (black bar with white indicators for each revision).
  3. Drag the white arrows to the versions to compare.

XCode 4 Compare Utility

Solution 3:

There is a button above the code window that looks like two file folders inverted one over the other. Click that button to open a side by side view of your file differences.

It's the far right button in the red box drawn on this screenshot.