-
-
Notifications
You must be signed in to change notification settings - Fork 544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm having trouble reading the root.inApp.plist #11
Comments
NSUserDefaults is your friend. To read a string with key "foo": NSString *foo = [[NSUserDefaults standardUserDefaults] stringForKey:@"foo"]; |
tried NSString *about = [[NSUserDefaults standardUserDefaults] stringForKey:@"about"]; "about" is a key in my root.plist and root.inApp.plist but it just returns nil, any ideas? I take i needs to initialize the settings? |
Yep, it's nil until initialized. You can create your initial userDefaults like this: NSString* pathToUserDefaultsValues = [[NSBundle mainBundle] pathForResource:@"userDefaults" ofType:@"plist"]; NSDictionary* userDefaultsValues = [NSDictionary dictionaryWithContentsOfFile:pathToUserDefaultsValues]; [[NSUserDefaults standardUserDefaults] registerDefaults:userDefaultsValues]; |
Look for user headers in the project folder first
Any help would be awesome, i at a dead end as to how to retrieve the data using your program from the plist files in settings bundle. Do you need to initialize the settings in the delegate and if not how do you get the data into a dic or array so i can use them in the app.
Sorry for the noob question its my first big app and i've never used settings bundle before.
Thanks
Matthew
The text was updated successfully, but these errors were encountered: