Re: NSTreeNode/representedObject

  • Never mind, I figured it out: item is now a subclass of NSTreeNode.
    Here's the new code.

    - (BOOL)outlineView:(NSOutlineView *)outlineView shouldCollapseItem:
    (id)item
    {
    id myObject = LEOPARD_OR_LATER ? [item representedObject] : [item
    observedObject];
    [myObject setExpanded:NO];
    return YES;
    }

    On Nov 9, 2007, at 10:03 AM, David Riggle wrote:

    > Can somebody explain how we're supposed to use the new NSTreeNode/
    > representedObject to replace the NSOutlineView observedObject hack
    > that was so darned convenient?  The following code
    >
    > - (BOOL)outlineView:(NSOutlineView *)outlineView shouldCollapseItem:
    > (id)item
    > {
    > id myObject = [item observedObject];
    > [myObject setExpanded:NO];
    > return YES;
    > }
    >
    > now produces an error message on the console:
    >
    > WARNING: Using deprecated NSTreeController internal API. Break on
    > 'observedObject' to debug. Use of this method should be replaced by
    > NSTreeNode/representedObject
    >
previous month november 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    
Go to today