Apple Developer Tool Tips

A few quick tips about Xcode, FileMerge, and creating project archives. They're simple, but invaluable if you happen to need them. Feel free to share your own if you like.

1. FileMerge can compare not just individual files but whole directories. This is a major lifesaver if you need to, for example, manually merge two versions of a project. FileMerge will tell you which files are different then show you the differences right inline when you click the file.

2. You can choose custom colors for entities in the Xcode modeler by choosing Format → Font → Show Colors, then dragging a color to an entity.

3. When you zip up a project for backup or sharing with other people, be sure to always close the project in Xcode and move the Build subfolder out before zipping up the project folder. It contains compiled binaries, index files, and many other things that can be easily re-built on the other end. The resulting file size difference can be tens of megabytes or more.

Colored Entities in Xcode
Design Element
Apple Developer Tool Tips
Posted Feb 23, 2007 — 15 comments below


Charles — Feb 23, 07 3640

I discovered FileMerge's directory compare ability a while ago while struggling with some backup files that needed to be compared against live directories. Oh man it was a lifesaver. But it can take a LONG time to compare large directories.

Jonas Greitemann — Feb 23, 07 3641

Assigning custom colors to entities is very useful! It helps me avoid loosing the overview in complex Core Data projects.

Great post. Thanks.

Aaron Tait — Feb 23, 07 3642

Well its about time that I figured out how to change an entity's color. Seriously though, they really hid that feature. I was getting kinda pissed that I couldn't make colorful posters out of my MOMs.

Dan Wood — Feb 23, 07 3643

Now if only FileMerge would understand character encoding and properly open Unicode files and so forth. It seems to be stuck in the ASCII 1970s. :-)

Bug submitted to apple, of course, others encouraged to do likewise.

Also: If you specify a separate Build directory from XCode's preferences, you don't need to worry about removing build directories! :-)

Peter Hosey — Feb 23, 07 3644

Scott Stevenson: When you zip up a project for backup or sharing with other people, be sure to always close the project in Xcode and move the Build subfolder out before zipping up the project folder.

This is an advantage of using Subversion to version-control your project, as you can do all of this with the “svn export” command. svn export will get rid of build folders, “*~.nib” packages, project view-settings files (Foo.xcodeproj/$USER.*), and anything else that you decided was too transient to version, without disturbing anything in your working-copy directory. This means that you don't need to rebuild nor reindex afterward.

Nigel Kersten — Feb 23, 07 3647

I'm not an Xcode expert by any means, but I got so sick of build directories cluttering up my source that I dedicated a whole directory for builds outside my source location.

That way I know the source is the source, and whenever I'm looking to reclaim space on my hard drive I can just empty the build directory.

Paul Collins — Feb 23, 07 3648

1. Option-drag an entity from the modeler to a window in Interface Builder to get a complete sample interface to it, including a filter field bound with predicate formats for all attributes!

2. In the SCM Results window, click the little button beneath the scroll bar to see the actual SCM commands and returns, including complete error messages.

Tim — Feb 23, 07 3649

I normally just set my Building preferences to place build products under /tmp/<username>/xcode so they are automatically cleaned up after a few days by /etc/daily.

Daniel Jalkut — Feb 24, 07 3650

I agree with Dan Wood about using a separate build directory. Not only do you keep the build junk out of the source directory, but if you plan on using any of Xcode's project-dependency features, a mutually shared build directory is a necessity. I've found like to be a lot better with a generally shared build directory. The one thing to look out for is if you've got more than one project that build the same framework, but at different versions, for instance. Then you'll need to be sure that you do a full clean when switching between them.

Blake C. — Feb 25, 07 3653


Doing it to a variable in the top-right view in the debugger shows numerous ways to interpret your data, including an arbitrary amount of raw hex in RAM.

Selecting a data type, method name, etc. in a source file, and then Control-clicking it allows you to see its definition in some header file, or jump to its documentation in the API reference.

Gabriel T. — Feb 26, 07 3655

There are even more options to customize Xcode via the command-line expert preferences!

Eric Wing — Feb 26, 07 3659

FileMerge is great, but I often work from the command line and wanted a way to launch and supply arguments directly. (I also hate how the open file panel in FileMerge doesn't retain the last used directory for Left and Right separately and instead combines the most recently used between the two. I usually diff files from different directories so I hate having to rehunt down my location every time.)

It was a while before I learned of the existence of 'opendiff' which is the command line way of launching FileMerge. For me, it is a much faster way of specifying the targets I want to compare.

cesar — Feb 26, 07 3660

best expert pref:

Setting this to NO will cause Xcode to turn off the warning sheet that is shown when you try to do an undo past the last save of a file.

Scott Stevenson — Feb 27, 07 3661 Scotty the Leopard

It was a while before I learned of the existence of 'opendiff' which is the command line way of launching FileMerge
Wow. I didn't know about that one. Excellent.

charles — Feb 27, 07 3663

Here's how you can use your text editor of choice with Xcode and some more basic Xcode Tools Tips.


Comments Temporarily Disabled

I had to temporarily disable comments due to spam. I'll re-enable them soon.

Copyright © Scott Stevenson 2004-2015