Re: Missing children in NSTreeController/NSOutlineView (SOLVED)

  • On 14/05/2012, at 19.15, Quincey Morris wrote:
    > On May 14, 2012, at 09:29 , Mikkel Eide Eriksen wrote:
    >> On 14/05/2012, at 18.07, Quincey Morris wrote:
    >>> On May 14, 2012, at 08:56 , Mikkel Eide Eriksen wrote:
    >>>> There it was! My "properties" property is an NSOrderedSet. After some more time in the debugger, I found out that the tree controller gets the object at children key path, and checks whether it's an NSSet or an NSArray. NSOrderedSet is neither, it inherits directly from NSObject and that appears to be the problem.
    >>>>
    >>>> As a quick hack to test this, I made a "propertiesSet" property that just returns [[self properties] set] and the children now show up as expected.
    >>>>
    >>>> I guess I'll have to refactor some things.
    >>>
    >>> Surely the correct thing to do is specify the "count" property (or some leaf property) explicitly in IB, isn't it?
    >>>
    >>> Presumably the tree controller is testing for NSSet or NSArray in order to decide whether it can default the missing selector to "count". If so, you should probably file a bug report. :)
    >>
    >> Explicitly setting the count key path to "count" gives me an exception from within  -[NSTreeControllerTreeNode _leafState] as soon as the window is loaded.
    >>
    >> 2012-05-14 18:23:13.562 GUITest[1805:703] -[_NSStateMarker unsignedIntegerValue]: unrecognized selector sent to instance 0x7faab1c18950
    >
    > In the absence of other information this sounds like a bug in NSTreeController. What happens if you change the count property in IB to "set.count"?

    Same error as above.

    > Did you intend to take this off-list?

    Oops, no. I was using reply-all and didn't notice that the list had slipped off :-)

    Mikkel
  • On 14/05/2012, at 19.37, Mikkel Eide Eriksen wrote:
    > On 14/05/2012, at 19.15, Quincey Morris wrote:
    >>
    >> In the absence of other information this sounds like a bug in NSTreeController. What happens if you change the count property in IB to "set.count"?
    >
    > Same error as above.

    With this information, some further googling reveals several others with the same problem:

    http://michaelrutt.tumblr.com/post/14986671491/ordered-relationships-and-bi
    ndings-really

    http://stackoverflow.com/questions/7039165/how-to-bind-nstreecontrollers-ch
    ildren-to-core-data-ordered-to-many-relationshi

    https://github.com/robertjpayne/DDOutlineView

    NSTreeController does not support NSOrderedSet.

    Mikkel
previous month may 2012 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