Skip to content

Instantly share code, notes, and snippets.

@priore
Created November 12, 2014 11:20
Show Gist options
  • Save priore/bb6f9cd11b1591552208 to your computer and use it in GitHub Desktop.
Save priore/bb6f9cd11b1591552208 to your computer and use it in GitHub Desktop.
Settings from a PLIST file
static NSDictionary *settings;
+ (id)settingsValueForKeyPath:(NSString*)keyPath
{
if (settings == nil) {
NSString *plistPath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"settings.plist"];
settings = [[NSDictionary alloc] initWithContentsOfFile:plistPath];
}
return [settings valueForKeyPath:keyPath];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment