Skip navigation.
 
mlBindings: NSArrayController <> Shared User Defaults - more detailed
FROM : Dominik Pich
DATE : Tue Jan 01 13:25:45 2008

Hi,
as the title states I have a Problem with binding my ArrayController 
to the Shared User Defaults...

I have for example this array:
<items>
   <dict>
       <key>name</key>
       <string>bla1</string>
       <key>enabled</key>
       <true/>
   </dict>
   <dict>
       <key>name</key>
       <string>bla22222</string>
       <key>enabled</key>
       <true/>
   </dict>
   <dict>
       <key>name</key>
       <string>bla33</string>
       <key>enabled</key>
       <true/>
   </dict>
</items>

--- Here's what I do:
-the above array I read from plist
- I use it as initial value for the NSUserDefault as a key: "items"

- I then bind an NSArrayController to the shared defaults controller
   using contentArray=values.items as the binding.
-To that Controller I bind the columns of a tableView.
   using value=arrangedObjects.name as the Binding for the 1. Column
   using value=arrangedObjects.enabled as the Binding for the 2. Column 
(using a PopupButtonCell)

--- all working great so far ^^
-> I can SEE the array I bound to just fine

---But now comes the Problem:
-> I want to be able to modify my array ... I dont want to add or 
remove objects BUT modify individual items' values. Especially I want 
to toggle their enabled states.

The changes I make in my tableView though (via the popupButtons) are 
not 'reqistered' by the defaults. I never get a notification something 
changed, nor does the defaults save the modified array.

Why is that? It seems to me that the new array is somehow considered 
to be identical to the old?

Regards,
Dominik

Related mailsAuthorDate
mlBindings: NSArrayController <> Shared User Defaults Dominik Pich Dec 31, 11:42
mlRe: Bindings: NSArrayController <> Shared User Defaults Jerry Krinock Dec 31, 15:44
mlBindings: NSArrayController <> Shared User Defaults - more detailed Dominik Pich Jan 1, 13:25