Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9064283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:12:40+00:00 2026-06-16T16:12:40+00:00

I am trying to store values in settings bundle child pane. I have the

  • 0

I am trying to store values in settings bundle child pane.

I have the Root.plist and the child moteurs.plist

In the moteurs.plist, I have 14 motors and I’d like to store 2 values (calibration coefficients) for each motor.
Those values need to be alterable by the user.

In the Root.plist I have :

<dict>
<key>PreferenceSpecifiers</key>
<array>
    <dict>
        <key>Title</key>
        <string>Moteurs</string>
        <key>Type</key>
        <string>PSGroupSpecifier</string>
    </dict>
    <dict>
        <key>Type</key>
        <string>PSChildPaneSpecifier</string>
        <key>Title</key>
        <string>Paramètres moteurs</string>
        <key>File</key>
        <string>moteurs</string>
        <key>Key</key>
        <string>moteurs</string>
    </dict>
    <dict>

In the moteurs.plist:

<dict>
<key>PreferenceSpecifiers</key>
<array>
    <dict>
        <key>Title</key>
        <string>L5K-070</string>
        <key>Type</key>
        <string>PSGroupSpecifier</string>
    </dict>
    <dict>
        <key>AutocapitalizationType</key>
        <string>None</string>
        <key>AutocorrectionType</key>
        <string>No</string>
        <key>DefaultValue</key>
        <string>0,0</string>
        <key>IsSecure</key>
        <false/>
        <key>Key</key>
        <string>coeff1_preference</string>
        <key>KeyboardType</key>
        <string>Number Pad</string>
        <key>Title</key>
        <string>Coeff 1</string>
        <key>Type</key>
        <string>PSTextFieldSpecifier</string>
    </dict>
    <dict>
        <key>AutocapitalizationType</key>
        <string>None</string>
        <key>AutocorrectionType</key>
        <string>No</string>
        <key>DefaultValue</key>
        <string>0,0</string>
        <key>IsSecure</key>
        <false/>
        <key>Key</key>
        <string>coeff2_preference</string>
        <key>KeyboardType</key>
        <string>Number Pad</string>
        <key>Title</key>
        <string>Coeff 2</string>
        <key>Type</key>
        <string>PSTextFieldSpecifier</string>
    </dict>

I faced a problem:
I am unable to initialize defaults values for the child ( or I don’t know how to read the values )

Root default values are initialized using this:

- (void)registerDefaultsFromSettingsBundle {
    [[NSUserDefaults standardUserDefaults] registerDefaults:[self defaultsFromPlistNamed:@"Root"]];
     [[NSUserDefaults standardUserDefaults] synchronize];
}

- (NSDictionary *)defaultsFromPlistNamed:(NSString *)plistName {
    NSLog(@"Traitement de %@:",plistName);

    NSString *settingsBundle = [[NSBundle mainBundle] pathForResource:@"Settings" ofType:@"bundle"];
    NSAssert(settingsBundle, @"Could not find Settings.bundle while loading defaults.");

    NSString *plistFullName = [NSString stringWithFormat:@"%@.plist", plistName];

    NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:[settingsBundle stringByAppendingPathComponent:plistFullName]];
    NSAssert1(settings, @"Could not load plist '%@' while loading defaults.", plistFullName);

    NSArray *preferences = [settings objectForKey:@"PreferenceSpecifiers"];
    NSAssert1(preferences, @"Could not find preferences entry in plist '%@' while loading defaults.", plistFullName);

    NSMutableDictionary *defaults = [NSMutableDictionary dictionary];
    for(NSDictionary *prefSpecification in preferences) {
        NSString *key = [prefSpecification objectForKey:@"Key"];
        id value = [prefSpecification objectForKey:@"DefaultValue"];
        if(key && value) {
            [defaults setObject:value forKey:key];
        }

        NSString *type = [prefSpecification objectForKey:@"Type"];
        if ([type isEqualToString:@"PSChildPaneSpecifier"]) {
            NSString *file = [prefSpecification objectForKey:@"File"];
            NSAssert1(file, @"Unable to get child plist name from plist '%@'", plistFullName);
            [defaults addEntriesFromDictionary:[self defaultsFromPlistNamed:file]];
        }
    }

    return defaults;
}

I can access root preferences values using

NSString *test = [[NSUserDefaults standardUserDefaults] stringForKey:@"serveur_preference"];
    NSLog(@"serveur:%@",test);

So how can I read child pane preference values ?
And what’s best practice to store the 2 coefficients for each motor?

Thanks a lot.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T16:12:41+00:00Added an answer on June 16, 2026 at 4:12 pm

    The child pane settings should be accessible using their usual identifiers (as specified in the plist), like so

    NSUserDefaults* settings = [NSUserDefaults standardUserDefaults];
    NSString* coeff1 = [settings stringForKey:@"coeff1_preference"];
    NSString* coeff2 = [settings stringForKey:@"coeff2_preference"];
    

    likewise, you can set the defaults using -NSUserDefaults registerDefaults:

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to use the Settings.bundle as the store for options using
I am trying to store/retrieve a value that is stored in the Application Settings.
I am trying to store values from an array, to a hash (array value
so I'm trying to store values in an array of Lists in C# winForms.
I am trying to store values in array using JavaScript, but I get strange
I am trying to store different values into an array based on a number
I'm trying to store multiple values for a key in a data structure so
I am trying to store a set of values in delphi, but i want
I'm trying to create a 2D array to store some values that don't change
I have a list of key/value pairs I'd like to store in and retrieve

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.