• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSArrayController <> Shared User Defaults - more detailed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArrayController <> Shared User Defaults - more detailed


  • Subject: Re: NSArrayController <> Shared User Defaults - more detailed
  • From: Matt Neuburg <email@hidden>
  • Date: Tue, 01 Jan 2008 11:35:20 -0800
  • Thread-topic: NSArrayController <> Shared User Defaults - more detailed

On Tue, 1 Jan 2008 13:25:45 +0100, Dominik Pich <email@hidden> said:
>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?

This might be all you need:

http://www.cocoabuilder.com/archive/message/cocoa/2006/4/22/161662

m.

--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
One of the 2007 MacTech Top 25: <http://tinyurl.com/2rh4pf>
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSArrayController <> Shared User Defaults - more detailed
      • From: Dominik Pich <email@hidden>
  • Prev by Date: Re: cocoa bindings NSTableColumn to @allKeys?
  • Next by Date: Re: NSTableView, NSArrayController, NSManagedObjectContext
  • Previous by thread: Re: cocoa bindings NSTableColumn to @allKeys?
  • Next by thread: Re: NSArrayController <> Shared User Defaults - more detailed
  • Index(es):
    • Date
    • Thread