New Comment Policy
Spammers have forced me to start moderating comments on this blog. The moderation applies only to the first comment you make. Your first comment will not appear on the blog immediately. When you submit the comment, it will go into a moderation queue for me to approve. Assuming your comment is not spam, it may take up to 24 hours for the comment to appear on the blog.
Once you get a comment approved, any future comments you make will not be subject to moderation. They will appear on the blog when you submit them.
Xcode 3.2: Renaming Projects
Xcode 3.2 added the ability to rename projects. Choose Project > Rename Project.

Xcode is set to rename all files in the project that are based on the project name: project file, targets, build products (application name is an example), precompiled headers, and property lists. If you want to keep the old name for some files, deselect the checkbox in the left column.
Reading Third-Party Documentation in Xcode 3.2
Apple supplies documentation sets that let you read Mac OS X, iPhone, and developer tools documentation in Xcode. But you are not limited to reading Apple’s documentation in Xcode. This post shows you how to install and read third-party documentation in Xcode.
Xcode has one requirement for third-party documentation sets. The documentation set must be either an RSS or Atom feed. If you want an example of a documentation set, the cocos2D game engine has an Atom feed at the following URL:
http://aptocore.com/downloads/cocos2d/cocos2d-iphone-doc.atom
Opening Xcode’s Documentation Preferences
Open Xcode’s preferences by choosing Xcode > Preferences. Click the Documentation button in the Xcode toolbar window. The Documentation button is on the far right. You’ll have to use the scroll bar to get to it unless you have a very wide monitor. You should see the documentation sets on the left side of the documentation preferences.

Adding a Documentation Feed
Click the Add Documentation Set Publisher button. You will be asked for a feed URL. RSS feeds start with feed:// while Atom feeds start with http://. Click the OK button when you’ve finished entering the feed URL.
Installing the Documentation
After adding your documentation feed, it should appear in the list of available sets. Click the Get button to install the documentation in Xcode.
Reading the Documentation
After installing the documentation, open Xcode’s documentation window by choosing Help > Developer Documentation. Click the Home button in the documentation window toolbar. A menu with a list of installed documentation sets opens. The documentation set you installed should be one of the menu choices. Choose it to read the documentation.
Removing the Documentation
To remove documentation you installed, open Xcode’s documentation preferences. Select the documentation set from the list of available sets. Right-click and choose Reveal In Finder. Drag the documentation set to the Trash.
OpenGL Profiler Workaround
I ran into a problem with OpenGL Profiler 4.2 on Snow Leopard. I would profile an application and pause profiling so I could look at the OpenGL statistics. When I opened the statistics window, it was blank. The trace window was also blank, and I had selected the Collect Trace checkbox in OpenGL Profiler’s main window.
My workaround was to open the statistics and trace windows and start profiling. When I did this, both windows filled with the appropriate profiling data.
Getting Started with Mac Programming
A question that comes up often in Mac programming forums is “Where do I start?” I have gathered a bunch of information and put it in this post to answer this question. Hopefully this helps people new to Mac development and reduces the frequency of “Where do I start?” questions on the forums.
NOTE: The information in this post is for people writing Mac GUI applications, not games. You could write a Mac game without having to learn Objective-C and Cocoa. Getting started in game development would be a good topic for a future post.
Update for Lion and Xcode 4 Users (July 2011)
Mac OS X 10.7 does not include Xcode. Download Xcode from the Mac App Store. The version of Xcode on the Mac App Store includes the iPhone SDK. Xcode 4 integrates Interface Builder with Xcode. There is no separate Interface Builder application.
The Tools You Need
If you have a copy of Mac OS X, you have the tools you need to write Mac applications. Apple includes developer tools, the Xcode Tools, with every copy of Mac OS X. Insert your Mac OS X DVD. The Xcode installer is in the Optional Installs folder.
Apple constantly updates their developer tools. To get the latest version of Xcode, go to Apple’s developer site. You will have to sign up for a free ADC membership before you can download Xcode.
If you’re interested in iPhone development, download the iPhone SDK instead of Xcode. The iPhone SDK contains both the Xcode Tools and the iPhone SDK. If you download Xcode, then download the iPhone SDK at a later date, you’re downloading Xcode twice, and Xcode is a large download.
After installing Xcode you will have all the tools you need to write Mac applications. The tools you will use the most are Xcode and Interface Builder.
Xcode is an integrated development environment. You will use Xcode to write your source code and compile the source code into a Mac application. You will use Interface Builder to create the user interface for your applications.
Learning a Programming Language
Before you can write Mac applications, you must know a programming language. If you have never programmed before, you will have to learn one. What language should you learn?
If you’re serious about writing Mac applications, you should eventually learn Objective-C. The Cocoa framework uses Objective-C as well as the Cocoa Touch framework, which is used to write iPhone applications.
Your First Language
Should you learn Objective-C first? If you post this question on a Mac programming message board, you will generate a lot of heated responses. These responses generally fall into three camps.
Camp 1: Learn Objective-C first. You have to know Objective-C to write Cocoa applications so you should go ahead and learn Objective-C.
Camp 2: Learn C, then Objective-C. Objective-C is a superset of C. It takes C and adds support for object-oriented programming. By learning C, you’ll make progress towards learning Objective-C.
Camp 3: Learn a language like Python or Ruby first. C and Objective-C are too difficult for a beginner. Python and Ruby are easier to learn. Start with one of them. After you learn Python or Ruby, you can move on to Objective-C.
Which camp is right? It depends on you and how you plan on learning Objective-C. If you plan on learning Objective-C through online tutorials, Camp 2 is right. Most Objective-C tutorials assume you know C so you would have to learn C first to understand the tutorials.
If you plan on learning Objective-C through Stephen Kochan’s Objective-C book (Amazon link), Camp 1 is right. The book doesn’t assume you know C so you can use the book to learn Objective-C without learning C first.
If you start learning C or Objective-C and have a hard time understanding the material, Camp 3 is right. Start with another language and learn Objective-C later.
Resources for Learning Programming
The World Wide Web is full of programming tutorials. The following sites will give you a large collection of programming language tutorials:
- CocoaDevCentral has tutorials on C and Objective-C.
- CProgramming.com has C tutorials.
- The Python website has tutorials for learning Python in the Documentation section.
- The Ruby website has Ruby tutorials in the Documentation section.
Some of you will prefer learning programming from a book. You can find books on Mac programming, Python, and Ruby from the following publishers:
Three programming language books that would help someone interested in Mac programming are the following:
- Learn C on the Mac by Dave Mark.
- Learn Objective-C on the Mac by Mark Dalrymple and Scott Knaster. This book is a sequel of sorts to Learn C on the Mac and assumes you’ve read Learn C on the Mac.
- Programming in Objective-C 2.0 by Stephen Kochan.
Learning Programming on a Mac
If you’re learning C or Objective-C, you can use Xcode to learn the language. Create a command-line tool project for each program you write. In Xcode 3.2 take the following steps to create a command-line tool project:
- Choose File > New Project in Xcode.
- Select Application under Mac OS X on the left side of the New Project Assistant.
- Select Command Line Tool at the top of the New Project Assistant.
- Pick your language from the Type pop-up menu. Choose Foundation for Objective-C.
- Click the Choose button.
- Name your project and pick a location to save it.
- Click the Save button.
Those of you running Xcode 4 should click the Next button after Step 3. The Choose button in Step 5 is named Next in Xcode 4. Step 6 is split in Xcode 4. You name the project when you pick a language.
For those of you running older versions of Xcode, create a Standard Tool project to learn C or a Foundation Tool project to learn Objective-C.
Some people think integrated development environments like Xcode hide too many details from beginning programmers, which hinders learning. They suggest beginners write their source code in a text editor and compile it from the Terminal application. For more information on compiling from the Terminal, read my Avoiding Xcode post.
If you’re learning Python or Ruby, I have good news. Mac OS X comes with Python and Ruby interpreters so you can start writing Python and Ruby programs right now. For Python and Ruby programming, I recommend using TextWrangler, which is a free text editor. You can write, run, and debug Python and Ruby programs inside TextWrangler. My TextWrangler and Interpreted Languages post has more information on using TextWrangler.
Learning Cocoa
After learning Objective-C, you can move on to learning Cocoa. Cocoa is Apple’s framework for writing GUI applications on Mac OS X. Cocoa is a large framework so prepare to spend a lot of time learning it.
Cocoa Books
When people ask for book recommendations on Mac programming message boards, the usual recommendation is Aaron Hillegass’ Cocoa Programming for Mac OS X (Amazon link). This book does a good job of teaching the fundamentals of Cocoa programming. Hillegass assumes the reader knows C so his book is not right for people completely new to programming.
Cocoa is becoming a hot topic for computer book publishers. You can find a lot of new and upcoming Cocoa books from the following publishers:
Cocoa Learning Resources
The biggest source for Cocoa documentation is Apple. You can read Apple’s documentation in Xcode by choosing Help > Developer Documentation. You can also read it online at Apple’s developer site.
Some other sites that will help you learn Cocoa are:
- CocoaDevCentral, which has a lot of Cocoa tutorials.
- CocoaDev, which has lots of Cocoa information and a forum to ask questions.
- PlanetCocoa, which is a large collection of Cocoa programming blogs.
- Cocoabuilder, which contains an archive of Apple’s Cocoa mailing list.
- Andy Matuschak has a learning path for Cocoa on his blog.
This list is obviously not exhaustive. Use your favorite search engine to find more resources for learning Cocoa development and learning programming in general.
Xcode 3.2: New Project Assistant
Xcode 3.1 changed the way you pick a project template when creating a new project. Previous versions of Xcode had a list of all installed project templates for you to choose. Xcode 3.1 filled the left side of the New Project Assistant with project categories like Application and Framework. Selecting the category filled the top of the New Project Assistant with the project templates in that category.
Xcode 3.2 makes further changes. Suppose you’re writing a Cocoa application in Objective-C. In Xcode 3.1 you could choose from the following templates:
- Cocoa Application
- Cocoa Document-based Application
- Core Data Application
- Core Data Document-based Application
- Core Data Document-based Application with Spotlight
In Xcode 3.2, you have one template: Cocoa Application. There is an Options section with checkboxes for document-based applications, Core Data, and Spotlight importer.

The screenshot provides a hint on how to create a command-line application in Xcode 3.2. Select Command Line Tool, and the Options checkboxes are replaced by a Type pop-up menu. Use the Type menu to pick the language: C, C++, or Objective-C. Choose Foundation to write an Objective-C command-line application.
The Story of the Blog Move
Normally I write about technical topics like Xcode, Mac development, SDL, and game development. But I am in the midst of a 30-day trial of MarsEdit, and I can’t think of a good technical topic right now so I am writing about my experience moving my blog to WordPress.
What I Was Using
For the past 18 months, I used RapidWeaver’s blog software to create the blog. RapidWeaver is a Mac website building application for people who want a good-looking site without having to hand code HTML and CSS. The biggest advantage of using RapidWeaver’s blog software is the blog matches the look of the rest of the site. But RapidWeaver’s blog software has two disadvantages.
First, the entire blog is treated as a single page. When you add a new post to the blog and export it, RapidWeaver creates the entire blog, not just the parts that changed. If your blog has a lot of posts, creating the entire blog every time you add a post is wasteful.
Second, RapidWeaver blogs do not provide navigation links to read older posts. Suppose your blog has 50 total posts and displays 10 posts per page. Someone visits your blog, reads the 10 most recent posts and wants to read the next 10 posts. The visitor can’t do that. All he or she can do is click archive links to read older posts.
I could live with these two weaknesses, but I encountered a third problem. When I created the blog with RapidWeaver, HaloScan was the built-in way to add comments to the site. HaloScan was purchased by JS-Kit. They are currently in the process of discontinuing HaloScan, moving them over to Echo, their new commenting system. Echo is not free, and I didn’t need all of its features so it was time to move on.
Finding a New Commenting System
Because a blog without comments isn’t much of a blog (I can write articles on my site if I want to share information without comments), I searched for a new commenting system. I found two systems to examine: Disqus and Intense Debate.
Disqus and Intense Debate had instructions on adding it to blogging platforms like WordPress and Blogger, but no RapidWeaver instructions. They had code to embed into a blog, but I couldn’t find a place to place the code in RapidWeaver.
I decided to see if there were better blogging solutions, and I came upon WP-Blog, which is a plug-in that lets you use a WordPress blog that matches the look of a RapidWeaver site. So I decided to try WordPress and WP-Blog.
Installing WordPress
Installing WordPress was very easy for me because my web host has support for Fantastico. Fanatastico lets you perform a one-click install of WordPress. The only thing I had to do was rename my old blog directory on my FTP site because I wanted to use the same directory for my WordPress blog.
After installing WordPress I logged into my WordPress account. From there I could access tools to import old blog posts to the WordPress blog. I used the RapidWeaver blog’s RSS feed to import my posts. As a bonus, I was able to use the Blogger import tool to import the posts from my old Blogger blog. It even imported the comments from Blogger.
The importing went well. The images from the RapidWeaver blog were missing, but I expected that. I didn’t have too many images to upload so it wasn’t a big problem. There were some line spacing issues importing the Blogger posts, but the posts were readable.
One last thing I did was change the permalink structure. The initial permalink structure is to use the post number like p41 or p92. I wanted more meaningful names so I changed the structure to use the month, year, and title. But this caused a problem because I didn’t have a .htaccess file in the blog directory. I created one in a text editor, pasted the code WordPress provided, and uploaded the .htaccess file to my site.
Installing WP-Blog
At this point I had my WordPress blog working, but I was using the default theme, which didn’t match the look of my site. I had to install WP-Blog. I copied the plugin, WP-Blog.rwplugin to the following location:
/Users/Username/Library/Application Support/RapidWeaver
After copying the WP-Blog plugin, I opened my site in RapidWeaver and added a WP-Blog page to my site. I opened the page inspector and configured the blog, including setting up the following information:
- The location of the blog
- The date format
- The number of archive links to show on the sidebar
- The location of the search field
- The RSS feeds
- Whether or not to allow permalinks
- Whether or not to allow comments
When I had the new blog set up, I exported the page. The export created four items:
- A files folder
- An index_files folder
- index.html
- index.php
I uploaded the files folder, the index_files folder, and index.php to my site, and my WordPress blog looked like the rest of my site.
Conclusion
So far I’m happy with the switch to WordPress. I have a blog that matches the rest of my site, has comments without my having to install a separate commenting system, has navigation links for older posts, and has search capabilities.
Update
I did not make myself clear when I originally wrote this post because I keep getting questions about commenting systems. I use the built-in WordPress commenting system.
I have not used or installed Disqus, Intense Debate, or any other commenting system. Because of this, I cannot answer any questions about what commenting system is best or answer any question about installing Disqus, Intense Debate, or any other commenting system.