I am facing a problem in accessing Settings.bundle.
Let me explain what exactly I am doing.
Now The very important steps.
Now In above steps, I have specified " I need a child pane for settings " & Child Pane settings will be loaded from FontSettings.plist
Ok. Further Steps.
For just verification that settings.bundle contains that file or not.
Now, For FontSettings.plist
Check in simulator.
Till now, I believe I have followed the correct steps.
The problem that I am facing is here now.
If there is just a single Root.plist, we can directly access
[[NSUserDefaults standardUserDefaults] stringForKey:@"fName"]
Like above.
But the question is "How to access - child pane settings ? "
I have tried following way
NSString *str=[[NSBundle mainBundle] pathForResource:@"Settings" ofType:@"bundle"];
NSString *path=[str stringByAppendingPathComponent:@"FontSettings.plist"];
NSDictionary *dFor=[NSDictionary dictionaryWithContentsOfFile:path];
But the problem in above code is "It's just giving me the same default value every time, even after - changing the values from settings of iPhone - settings.
What should I do for Accessing Child.plist settings? (that user has set).
You access child pane settings exactly like the root settings. There's no difference between hierarchies in accessing the user defaults.
For instance, if a PSToggleSwitchSpecifier in FontSettings.plist has Key
being isBold
, then you'll access this setting with
[[NSUserDefaults standardUserDefaults] boolForKey:@"isBold"]