Matthew Price

“We are put on this planet only once, and to limit ourselves to the familiar is a crime against our minds.”

Roger Ebert

#Pragma Declarations

NSHipster posted an excellent article on #pragma tricks for Xcode. For the uninitiated, Xcode uses #pragma declarations to help you organize code into sections and disable compiler warnings.

If you aren’t using #pragma yet then I highly recommend perusing the article.

London 2012: The Opening Ceremony

Fireworks Over The Olympic Stadium

The Atlantic has posted a beautiful photo essay of the opening ceremony for the 2012 Summer Olympics in London.

New Objective-C Literals in Xcode 4.4

The newly released Xcode 4.4 let’s you create literals for NSArray, NSDictionary, and NSNumber just like you can with NSString. You can also use [] syntax to access containers such as NSArray and NSDictionary.

Hit the source link for a full list of example code.

Discovery Mated To Shuttle Carrier Aircraft

Discovery Mated To Shuttle Carrier Aircraft

More photos of Discovery’s 747 flight can be found at the Washington Post.

Node.js for Fedora, CentOS, and Amazon Linux

Update: The method mentioned below no longer works because the website hosting it has been offline for several months.


If you’ve recently tried to compile Node.js on a server running CentOS then you probably ran into show-stopping syntax errors. Unfortunately CentOS still ships with Python 2.4 by default even though it was released almost 8 years ago. To compile Node.js from the source you need Python 2.6 or higher.

A repository-based solution is your best alternative to finding a safe, headache-free way of updating Python. The source link is amazingly easy to set up and you get the added benefit of updating Node.js in the same manner as all your other installed packages.

On CentOS:

$ wget http://nodejs.tchol.org/repocfg/el/nodejs-stable-release.noarch.rpm
$ yum localinstall --nogpgcheck nodejs-stable-release.noarch.rpm
$ yum install nodejs-compat-symlinks npm

OTX Crashing with NSInvalidArgumentException: 'launch path not accessible'

Over the weekend I ran into a nasty error that caused otx to crash with NSInvalidArgumentException: 'launch path not accessible' before each run. After quite a bit of searching I finally found a solution on Cocoa Builder.

It appears that otx calls xcode-select -print-path each time it runs in order to locate the Developer tools, specifically otool. Since Apple is now bundling some developer tools into one application I had deleted /Developer and installed the new version into the main Applications folder.1 Unfortunately xcode-select was still pointing to the old Developer folder.

To correct the location and stop the crashes all I had to run was xcode-select -switch /Applications/Xcode.app/Contents/Developer.

  1. The moral of this story is probably “If you don’t know what it does then don’t delete it” but that would require a lifestyle change I’m not ready to commit to yet.

Helpful Per-File Compiler Flags for Xcode

If you’ve ever included third party classes in your Xcode project then you know just how distracting it can be to get warnings for code that you trust or that you aren’t allowed to modify.

To help save your sanity—and bring focus to warnings for code you can change—here’s a helpful listing of per-file compiler flags.1

  • Disable the static analyzer: -Xanalyzer -analyzer-disable-checker
  • Disable Auto Retain Counting (ARC): -fno-objc-arc
  • Disable all warnings: -w
  1. I cannot stress enough that you should never disable warnings for your own code.

Location of Xcode Companion Apps

With the release of Xcode 4.3 Apple has started bundling most of its developer applications into one file (Xcode.app) instead of using the /Developer directory.

If you’re like me and use a launcher such as Alfred then you’re probably wondering where some of your old developer applications ran off to. I’ve listed the locations below so that you can easily add them back to the list of included directories.

Xcode.app/Contents/Applications/:

  • Application Loader.app
  • FileMerge.app
  • Icon Composer.app
  • Instruments.app
  • OpenGL ES Performance Detective.app

Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/:

  • iPhone Simulator.app

Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Applications/:

  • Printer Simulator.app