1

This is the code in my AppDelegate:

    NSString *pathStr = [[NSBundle mainBundle] bundlePath];
    NSString *settingsBundlePath = [pathStr stringByAppendingPathComponent:@"Settings.bundle"];
    NSString *finalPath = [settingsBundlePath stringByAppendingPathComponent:@"Root.plist"];

    NSDictionary *settingsDict = [NSDictionary dictionaryWithContentsOfFile:finalPath];
    NSArray *prefSpecifierArray = [settingsDict objectForKey:@"PreferenceSpecifiers"];

prefSpecifiersArray is setted to 0x0 < nil >. I really don't know how is it possible! This is my Root.plist:

enter image description here

Lolloz89
  • 2,809
  • 2
  • 26
  • 41
  • I'd double check `finalPath` and `settingsDict`. Also check Settings.bundle is being copied to the app bundle. – djromero Dec 09 '11 at 10:48
  • Ok, when i build the app, the preference don't load. Why? Is there something wrong in the Settings.Bundle? – Lolloz89 Dec 09 '11 at 11:36

1 Answers1

0

The values from settings.bundle do not actually load to NSUserDefaults until the user opens the settings for the first time. By default, they are off. Once the user opens the settings bundle, they will fill in for you.

Bill Burgess
  • 14,054
  • 6
  • 49
  • 86