Richard Hart

Head of Something @ Somewhere
Kent, UK

My Music
My Photos

LinkedIn
Mastodon

Accessing values in your plist file from your iPhone/iPad app

Recently I’ve been coding some iPhone and iPad apps with multiple targets, all sharing the same codebase. Previously I had been using Preprocessor Macros to get the job done, but that soon turns messy and hard to maintain. I’ve since moved to just storing target specific values in each apps related plist file. Retrieving a value is as simple as:

 NSDictionary* infoDict = [[NSBundle mainBundle] infoDictionary];
 NSString *someString = [infoDict objectForKey:@"SomeKey"];