Using SDL with Xcode 4

January 9th, 2012

Filed under: SDL, Xcode | 25 comments

Apple changed the format for project templates in Xcode 4. The format change means the Xcode templates that ship with the Mac version of SDL don’t work in Xcode 4. If you have both Xcode 3 and 4 installed on your Mac, you can create a project that uses SDL in Xcode 3 and open […]


OpenGL Driver Instrument

December 12th, 2011

Filed under: Instruments, OpenGL | Be the first to comment!

Researching Instruments for Xcode Tools Sensei allowed me to become familiar with most of the built-in instruments. Due to the high number of instruments, there was no way for me to cover them all in the book. I focused on the most commonly used instruments in the book. I can use this blog to explain […]


Creating Custom Xcode 4 Project Templates

December 5th, 2011

Filed under: Xcode | 22 comments

This post contains the material on custom project templates I had prepared for the book. The material was not strong enough to put in the book, mainly because creating custom project templates manually in Xcode 4 is difficult (much more difficult than in previous versions of Xcode) and not documented by Apple. I had a […]


Xcode 4.2: Application and Logic Unit Test Classes

November 30th, 2011

Filed under: Xcode | Be the first to comment!

In Xcode 4.2 when you add a new Objective-C test case class to your project and click the Next button, you will see a Test Type menu. This menu has two choices: Application and Logic. The menu determines the unit test Xcode adds in the class’s implementation file. If you choose Application, Xcode adds a […]


Xcode 4: Open New Tab When Double-Clicking a File

November 28th, 2011

Filed under: Xcode | 1 comment

Xcode 4 adds support for tabbed editing. When using tabbed editing you most likely want Xcode to open a new tab when you open a file from the project navigator. To get this behavior you must tell Xcode to open a new tab when you double-click a file in the project navigator. Open Xcode’s preferences. […]


Creating Custom Xcode 4 File Templates

November 17th, 2011

Filed under: Xcode | 12 comments

This post contains the material on custom file templates I had prepared for the book. I decided not to put this material in the book because it wasn’t strong enough for me to support. But information on creating custom file templates in Xcode 4 isn’t easily available so I’m making it available here. I hope […]


Xcode 4.2 Convert to ARC Troubleshooting

November 3rd, 2011

Filed under: Xcode | 3 comments

One of Xcode 4.2’s new features is compiler support for ARC (Automatic Reference Counting), which automates memory management of Objective-C objects. Xcode 4.2 includes a refactoring tool to convert an existing project to ARC. Choose Edit > Refactor > Convert to Objective-C ARC. When you convert a project to ARC, a sheet opens that walks […]


Xcode 4: Setting Compiler Flags for a Single File

October 24th, 2011

Filed under: Xcode | Be the first to comment!

In Xcode 4 you can set compiler flags for a single file from the target’s Compile Sources build phase. Select the project file from the project navigator to open the project editor. Select the target from the left side of the project editor. Click the Build Phases button at the top of the editor. Click […]


Event Profiler and Counters Instruments

October 18th, 2011

Filed under: Instruments | Be the first to comment!

Xcode 4.2 adds two instruments for Mac applications that users of the Shark performance tool will appreciate. The Event Profiler instrument records a sample when a low-level event occurs. The Counters instrument samples your application and collects PMC (Performance Monitor Counter) events. PMC events are low-level CPU events, such as incorrectly predicted branches and cache […]


Using Makefiles in Xcode 4

October 12th, 2011

Filed under: Xcode | 2 comments

Sometimes I read questions from developers who want to use makefiles in Xcode. The short answer to their questions is to create an external build system project. The rest of this article provides a longer answer for those of you using Xcode 4. Create an External Build System Project An external build system project uses […]