nsarraycontroller and nsuserdefaultscontroller

  • I'm having some difficulties getting the values I set in a
    NSArrayController via setContent propogating to my
    NSUserDefaultsController.

    I have a NSTableView bound to an NSArrayController.  I have that
    NSArrayController's contentArray bound to a
    NSUserDefaultsController.  All bindings are setup via IB.

    Things seem to work fine and dandy if I add rows to the NSTableView
    via NSArrayController's insert action: the new row gets saved to
    defaults just fine.  If, however, I try to set the contents of the
    NSTableView all at once via NSArrayController's setContent, nothing
    gets saved to defaults.  Am I missing a step somewhere?

    Thanks

    - Jeff
  • --- Jeff Lee <gonzojl...> wrote:

    > Things seem to work fine and dandy if I add rows to
    > the NSTableView
    > via NSArrayController's insert action: the new row
    > gets saved to
    > defaults just fine.  If, however, I try to set the
    > contents of the
    > NSTableView all at once via NSArrayController's
    > setContent, nothing
    > gets saved to defaults.  Am I missing a step
    > somewhere?

    Take a look at the documentation for setContent:. I
    don't think that's what you want.

    Cheers,
    Chuck

          ____________________________________________________________________________________
    Tonight's top picks. What will you watch tonight? Preview the hottest shows on Yahoo! TV.
    http://tv.yahoo.com/
  • Thanks for the reply.  Yeah, I switched to using addObjects instead
    and things now work correctly.  Thanks!

    I still don't quite understand why setContent is not what I wanted
    though?  Do you have any idea why setContent wouldn't work?

    - Jeff

    On Oct 7, 2007, at 6:59 PM, Charles Steinman wrote:

    > --- Jeff Lee <gonzojl...> wrote:
    >
    >> Things seem to work fine and dandy if I add rows to
    >> the NSTableView
    >> via NSArrayController's insert action: the new row
    >> gets saved to
    >> defaults just fine.  If, however, I try to set the
    >> contents of the
    >> NSTableView all at once via NSArrayController's
    >> setContent, nothing
    >> gets saved to defaults.  Am I missing a step
    >> somewhere?
    >
    > Take a look at the documentation for setContent:. I
    > don't think that's what you want.
    >
    > Cheers,
    > Chuck
    >
    >
    >
    > ______________________________________________________________________
    > ______________
    > Tonight's top picks. What will you watch tonight? Preview the
    > hottest shows on Yahoo! TV.
    > http://tv.yahoo.com/
    >
previous month october 2007 next month
MTWTFSS
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Go to today