Search code examples
cocoainterface-buildernsdictionarynsuserdefaultscocoa-bindings

How to bind objects in NSDictionary in NSUserDefaults?


How do I bind NSDictionary objects to several text fields in Interface Builder?

I would like to bind each object to a specific item in the dictionary. For example, the first text field should be bound to Actor:

enter image description here


Solution

  • Try to add NSDictionaryController to you .xib file, then bind its Controller Content to your dictionary in User Defaults. Then you can bind text field values to Dictionary Controller (arrangedObjects key).

    I never tried that but I think it must work.

    Hope, it helps.