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 7007091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:33:46+00:00 2026-05-27T21:33:46+00:00

I have created two dictionaries in the user defaults of my application to represent

  • 0

I have created two dictionaries in the user defaults of my application to represent the controls of two players, as such:

Player1 = {
    MoveLeft = 0;
    MoveRight = 2;
    MoveDown = 1;
,
Player2 = {
    MoveLeft = 40;
    MoveRight = 41;
    MoveDown = 37;
}

And when I access [NSUserDefaults.standardUserDefaults valueForKeyPath:@"Player2.MoveLeft"], I do get a NSNumber with 40.

I am trying to bind several text fields to these values with the regular bindings mechanism. When I select the text field, this is what shows up:

Bind To = Shared User Defaults Controller, Controller Key = value, Model Key Path = Player2.MoveLeft, Value Transformer = SRKeyCodeTransformer

However, the text field is empty when I run the application. (Even if I remove the value transformer.) If I try to bind to a top-level property (like if I define foo in the defaults with a value of 40), it works.

What’s wrong with my binding? How can I access an element from a nested dictionary?

  • 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-05-27T21:33:46+00:00Added an answer on May 27, 2026 at 9:33 pm

    I don’t remember where exactly, but I found my answer: you cannot bind to non-top-level objects in the user defaults because the collections are immutable.

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

Sidebar

Related Questions

I have created two DbContexts, one is for application configuration, the second is for
I have created two forms in my Windows Application. One Form acts as a
I have created two viewController classes such that one is superclass of another.i have
I have created two layout files (in res/layout and res/layout-land) for my application. But
I have created an array, two dictionaries and a tableview. The tableview should display
I have two dictionaries of data and I created a function that acts as
I have created two imageViews promatically as shown below: public void createImageViews(Integer count){ ImageView[]
I have created two WindowSurface (WPF), and I want to navigate betwen them. I've
I have created two tables & inserted values as shown below . Table 1
I have created two Pages Page1.xaml and Page2.xaml in windows8 metro apps. I have

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.