Created
November 12, 2014 11:20
-
-
Save priore/bb6f9cd11b1591552208 to your computer and use it in GitHub Desktop.
Settings from a PLIST file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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