• 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
NSTreeController KVO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTreeController KVO


  • Subject: NSTreeController KVO
  • From: "Hamish Allan" <email@hidden>
  • Date: Mon, 7 Apr 2008 01:30:39 +0100

Hi,

I have an NSOutlineView bound to an NSTreeController, in turn bound to
an NSMutableArray whose contents are:

(
  {
    children =
      (
        { displayName = "child 1"; },
        { displayName = "child 2"; }
      );
    displayName = "parent";
  }
)

The bindings are set up as you might expect such the the NSOutlineView
displays the heirarchy correctly. All dictionaries and arrays within
are mutable.

If my model is updated with [[myRootArray objectAtIndex:0]
setObject:@"new parent description" forKey:@"displayName"], the
parent's name is updated correctly in the NSOutlineView.

If my model is updated with [[[[myRootArray objectAtIndex:0]
objectForKey:@"children"] objectAtIndex:0] setObject:@"new child 1
description" forKey@"displayName"], the first child's name is updated
correctly in the NSOutlineView.

However, if my model is updated with [[[myRootArray objectAtIndex:0]
objectForKey:@"children"] addObject:[NSMutableDictionary
dictionaryWithObject:@"child 3" forKey:@"displayName"]], the
NSOutlineView is not updated.

That is to say, though the objects contained within the children array
are being observed, the array itself appears not to be.

Is this expected behaviour? If so, how can I best work around it?

Thanks,
Hamish
_______________________________________________

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: NSTreeController KVO
      • From: Chris Suter <email@hidden>
  • Prev by Date: Re: Menu Key Equivalents Not Displayed
  • Next by Date: Re: Scaling a window background image quickly
  • Previous by thread: Re: Beginner reading, etc.
  • Next by thread: Re: NSTreeController KVO
  • Index(es):
    • Date
    • Thread