When you NSArrayControllerbind the contentArray to NSUserDefaultsControlleryou, you need to check the box "Handle content as a composite value" when binding. This has become common wisdom, but what does this option really do?
I wrote a small test application and could notice that with the option turned on, everything contentArrayis transferred to the binding source setValue:forKey:whenever you edit an element property in an array. When the parameter is turned off, only the element object itself changes, and the binding source is not notified.
This explains why this parameter is necessary for work NSUserDefaultsController(otherwise it would not have noticed that you edited something in the array and never saved the changes). But that doesn’t explain who does what exactly is different. The array controller takes over this option and writes an array of contents when it watches the change? If so, how does this relate to the stated purpose of the option, which is to “use a reversible value transformer to temporarily translate [...] the composite values into smaller pieces”?
source
share