Reading Common and Custom Values From Your Info.plist

It seems like a pretty simple, common thing you would want to do in objective-c right? All applications have an Info.plist (or a different plist file as defined in your “Info.plist File” property of your build target). I’ve been pretty frustrated with the quality of google search results when trying to figure out how to do more or less mundane things with the iPhone SDK. I’m going to start writting posts, especially when I have a hard time trying to find what I was looking for in search results.

Here’s the quick and dirty: I have a game that we’re building here at Treemo Labs, Tic A Tac Poker. We’re working on getting a lite version out the door. I wanted to read a custom value out of the Info.plist to tell if it’s the lite version or not. I couldn’t figure out how to read a simple value from the default property list file. Here’s some sample code to get the bundleIdentifier, bundle version and custom values from your Info.plist

To see an alphabetical list of the standard keys you can use in an information property list file, along with a brief description and the platforms to which they apply (Mac OS X or iPhone) check out the Property List Key Reference.