Tag Archives: xcode

VCS for Cocoa Programming for Mac OS X

I am working my way through [Aaron Hillegass][aaron]’ [Cocoa Programming for Mac OS X][cocoa] (again). I find it a good book, despite the fact I’ve started it twice before and have abandoned my tuition twice before. I like to think my progression is an awful lot like young [Luke Skywalker recklessly abandoning his Jedi training][luke] on Dagobah in order to save his Web application friends in the cloud city called Bespinternet. Eventually Luke (and I) will go back to complete his (and my) training and will become a truly great Jedi programmer for Mac OS X.

Anyway, for the first few chapters the book leads you through a number of small applications, each exercise starting a new project. Then in the later chapters Hillegass has you adding features to a single project called RaiseMan.

It strikes me that the next edition of the book should introduce using version control to track development.

Many chapters in the book end with challenges that go off on a tangent, getting you to implement alternate approaches to the exercises covered in that chapter. But then the subsequent chapter will expect you to work with the version of the RaiseMan application as it stood before the previous chapter’s programming challenge.

This is a natural fit for revision control (aka [VCS][vcs]). The book would teach you how to tag “release” versions of your code. It would teach you how to create an experimental feature branch for the chapter-end challenges, and then how to resume development from the last “release” version for the next chapter’s main exercises.

This is particularly relevant now that [Xcode 4 includes Git integration][xcodegit]. Of course there is no reason one can’t employ a suitable version control system with the current (third) edition of the book; I just think it makes a lot of sense to get younglings used to this workflow while teaching them all the other stuff about lightsabres and [the Force][rdf] while you’re at it.

You will up-vote this on [Reddit][reddit] / [Hacker News][hn] *(waves hand like her Imperial majesty)*.

[cocoa]: http://www.bignerdranch.com/book/cocoa%C2%AE_programming_for_mac%C2%AE_os_x_3rd_edition
[aaron]: http://www.bignerdranch.com/instructors/hillegass.shtml
[luke]: http://www.youtube.com/watch?v=om6ctZWNw18
[forum]: http://forums.bignerdranch.com/viewforum.php?f=5
[xcodegit]: https://github.com/blog/810-xcode-4-released-with-git-integration
[reddit]: http://reddit.com/
[hn]: http://news.ycombinator.com/
[rdf]: http://www.folklore.org/StoryView.py?project=Macintosh&story=Reality_Distortion_Field.txt
[vcs]: http://en.wikipedia.org/wiki/Revision_control

Xcode and Mercurial .hgignore

For future reference, culled from [Peter Hosey][1] and [Ben Clark-Robinson][2], a mostly useful `.hgignore` definition for use with an [Xcode][xcode] project stored in the [Mercurial version control system][mercurial].

syntax: glob
*.pyc
.DS_Store
._*
*.xcodeproj/*.pbxuser
*.xcodeproj/*.perspective*
*.xcodeproj/*.mode*

syntax: regexp
^build/

*Ugh* to `.DS_Store` files and *gaaaaaah* to resource forks wedged into dot-underscore files. *Yay!* to regular expressions.

[1]: http://boredzo.org/blog/archives/2008-03-20/hgignore-for-mac-os-x-applications
[2]: http://mozketo.com/mercurial-hgignore-for-xcodecocoa/
[mercurial]: http://mercurial.selenic.com/
[xcode]: http://developer.apple.com/technologies/tools/xcode.html