Skip navigation.
 
mlNSArrayController and NSUserDefaultsController values not saving...
FROM : Samuel Williams
DATE : Wed Apr 02 22:39:08 2008

Hi,

I have an app I am working on which will eventually be released open 
source available from http://svn.oriontransfer.org/Applications/GPSTool

That program has a menu item under preferences which shows a window. 
That window has an NSTableView bound to an NSArrayController. This 
appears to work okay, for example, clicking + to add a row and then 
editing the text appears to work. However, the row hasn't been saved 
correctly - I made a debug button to print out the data from the array 
controller and user defaults controller:

2008-04-03 05:29:50.749 GPS Tool[12595:10b] NSUserDefaultsController 
presetScripts: (
        {
    }
)
2008-04-03 05:29:50.750 GPS Tool[12595:10b] Arranged Objects: (
        {
        name = Bob;
    }
)

For some reason, a row has been created correctly, but the data has 
not been updated correctly (i.e. the name Bob).

  I can't seem to get this to work - I tried selecting continuously 
updates value, but that didn't have any effect.

It seems like for some reason, the updated data inside the 
NSMutableDictionary is not being written back into the 
NSUserDefaultsController, only when it is created is it added into the 
user defaults controller....

What is the correct way to implement this kind of bindings connection? 
I could easily make some glue code to resolve this issue but it 
wouldn't be as nice as what I'd expect bindings to be capable of..

Regards,
Samuel

Related mailsAuthorDate
No related mails found.