Binding NSTreeController to NSBrowser

  • Hey all,

    Part of my app takes an XML input file, hands it to an
    NSTreecontroller which is bound to an NSBrowser. This works fine under
    tiger but is broken under leopard.

    I think I have traced the problem to where the NSBrowsers content is
    bound to treeController.arrangedObjects. The arrangedObjects binding
    seems to have changed under leopard, also from the docs I get the
    impression I was never supposed to use that binding anyway.

    So what should I do so that this works in both tiger and leopard?

    Many Thanks

    Chris
  • Hey all,

    Since there was no activity on this I've raised a bug, radar id
    5649518. Any help on getting round this bug until there is a fix would
    be greatly apreciated.

    Thanks

    Chris

    On 12/14/07, Chris Blackburn <cblackburn36...> wrote:
    > Hey all,
    >
    > Part of my app takes an XML input file, hands it to an
    > NSTreecontroller which is bound to an NSBrowser. This works fine under
    > tiger but is broken under leopard.
    >
    > I think I have traced the problem to where the NSBrowsers content is
    > bound to treeController.arrangedObjects. The arrangedObjects binding
    > seems to have changed under leopard, also from the docs I get the
    > impression I was never supposed to use that binding anyway.
    >
    > So what should I do so that this works in both tiger and leopard?
    >
    > Many Thanks
    >
    > Chris
    >
    >
    >
  • On Mon, 17 Dec 2007 23:47:39 +0000, "Chris Blackburn"
    <cblackburn36...> said:
    > Hey all,
    >
    > Since there was no activity on this I've raised a bug, radar id
    > 5649518. Any help on getting round this bug until there is a fix would
    > be greatly apreciated.
    >
    > Thanks
    >
    > Chris
    >
    > On 12/14/07, Chris Blackburn <cblackburn36...>  wrote:
    >> Hey all,
    >>
    >> Part of my app takes an XML input file, hands it to an
    >> NSTreecontroller which is bound to an NSBrowser. This works fine under
    >> tiger but is broken under leopard.
    >>
    >> I think I have traced the problem to where the NSBrowsers content is
    >> bound to treeController.arrangedObjects. The arrangedObjects binding
    >> seems to have changed under leopard, also from the docs I get the
    >> impression I was never supposed to use that binding anyway.

    Could I steal this thread to ask a more elementary question? Chris, it
    sounds like you can actually help with this so I hope you don't mind my
    piggybacking here.

    All I want to do is make a simple NSBrowser on Leopard (only) using
    NSTreeController and NSTreeNode. My NSTreeController's content object is
    bound to an NSTreeNode which itself has a subnode I've given it; the tree is
    created using NSTreeNode treeNodeWithRepresentedObject (my "represented
    objects" are simply strings) and mutableChildNodes, as you would expect, and
    I can see that the tree is being created, and I can see that the
    NSTreeController's content is indeed the tree. So things would appear to be
    working from that point of view.

    My problem is that the NSBrowser is not displaying anything when the app
    runs. It's bound to the NSTreeController's arrangedObjects.

    Can someone set me straight? This should be the simplest thing in the world
    to do, so presumably all I need is some kind of dope slap... Please provide
    it! Thx - m.

    --
    matt neuburg, phd = <matt...>, <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>
  • Hi,

    This is exactly the problem I have. I have spoken off list to an apple
    employee and they say they are hard at work on a fix so hopefully it
    will be here soon.

    In the mean time I'm working on a temporary interface class as a
    stopgap. I'll keep you informed as to my progress.

    Chris

    On 18 Dec 2007, at 19:38, Matt Neuburg <matt...> wrote:

    > On Mon, 17 Dec 2007 23:47:39 +0000, "Chris Blackburn"
    > <cblackburn36...> said:
    >> Hey all,
    >>
    >> Since there was no activity on this I've raised a bug, radar id
    >> 5649518. Any help on getting round this bug until there is a fix
    >> would
    >> be greatly apreciated.
    >>
    >> Thanks
    >>
    >> Chris
    >>
    >> On 12/14/07, Chris Blackburn <cblackburn36...> wrote:
    >>> Hey all,
    >>>
    >>> Part of my app takes an XML input file, hands it to an
    >>> NSTreecontroller which is bound to an NSBrowser. This works fine
    >>> under
    >>> tiger but is broken under leopard.
    >>>
    >>> I think I have traced the problem to where the NSBrowsers content is
    >>> bound to treeController.arrangedObjects. The arrangedObjects binding
    >>> seems to have changed under leopard, also from the docs I get the
    >>> impression I was never supposed to use that binding anyway.
    >
    > Could I steal this thread to ask a more elementary question? Chris, it
    > sounds like you can actually help with this so I hope you don't mind
    > my
    > piggybacking here.
    >
    > All I want to do is make a simple NSBrowser on Leopard (only) using
    > NSTreeController and NSTreeNode. My NSTreeController's content
    > object is
    > bound to an NSTreeNode which itself has a subnode I've given it; the
    > tree is
    > created using NSTreeNode treeNodeWithRepresentedObject (my
    > "represented
    > objects" are simply strings) and mutableChildNodes, as you would
    > expect, and
    > I can see that the tree is being created, and I can see that the
    > NSTreeController's content is indeed the tree. So things would
    > appear to be
    > working from that point of view.
    >
    > My problem is that the NSBrowser is not displaying anything when the
    > app
    > runs. It's bound to the NSTreeController's arrangedObjects.
    >
    > Can someone set me straight? This should be the simplest thing in
    > the world
    > to do, so presumably all I need is some kind of dope slap... Please
    > provide
    > it! Thx - m.
    >
    > --
    > matt neuburg, phd = <matt...>, <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>
    >
    >
    >
  • I just tried this and it appears to work (on 10.5).  In addition to
    binding the browser's content to the tree controller's
    arrangedObjects, I also bound the browser's contentValues to the tree
    controller's arrangedObjects with model key path representedObject.
    My tree controller's content is bound to a hierarchy of NSTreeNode
    with strings as represented objects...

    dave

    On 18-Dec-07, at 12:38 PM, Matt Neuburg wrote:

    > On Mon, 17 Dec 2007 23:47:39 +0000, "Chris Blackburn"
    > <cblackburn36...> said:
    >> Hey all,
    >>
    >> Since there was no activity on this I've raised a bug, radar id
    >> 5649518. Any help on getting round this bug until there is a fix
    >> would
    >> be greatly apreciated.
    >>
    >> Thanks
    >>
    >> Chris
    >>
    >> On 12/14/07, Chris Blackburn <cblackburn36...> wrote:
    >>> Hey all,
    >>>
    >>> Part of my app takes an XML input file, hands it to an
    >>> NSTreecontroller which is bound to an NSBrowser. This works fine
    >>> under
    >>> tiger but is broken under leopard.
    >>>
    >>> I think I have traced the problem to where the NSBrowsers content is
    >>> bound to treeController.arrangedObjects. The arrangedObjects binding
    >>> seems to have changed under leopard, also from the docs I get the
    >>> impression I was never supposed to use that binding anyway.
    >
    > Could I steal this thread to ask a more elementary question? Chris, it
    > sounds like you can actually help with this so I hope you don't mind
    > my
    > piggybacking here.
    >
    > All I want to do is make a simple NSBrowser on Leopard (only) using
    > NSTreeController and NSTreeNode. My NSTreeController's content
    > object is
    > bound to an NSTreeNode which itself has a subnode I've given it; the
    > tree is
    > created using NSTreeNode treeNodeWithRepresentedObject (my
    > "represented
    > objects" are simply strings) and mutableChildNodes, as you would
    > expect, and
    > I can see that the tree is being created, and I can see that the
    > NSTreeController's content is indeed the tree. So things would
    > appear to be
    > working from that point of view.
    >
    > My problem is that the NSBrowser is not displaying anything when the
    > app
    > runs. It's bound to the NSTreeController's arrangedObjects.
    >
    > Can someone set me straight? This should be the simplest thing in
    > the world
    > to do, so presumably all I need is some kind of dope slap... Please
    > provide
    > it! Thx - m.
    >
    > --
    > matt neuburg, phd = <matt...>, <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
    >
  • On or about 12/18/07 12:07 PM, thus spake "Chris Blackburn"
    <cblackburn36...>:

    > Hi,
    >
    > This is exactly the problem I have. I have spoken off list to an apple
    > employee and they say they are hard at work on a fix so hopefully it
    > will be here soon.
    >
    > In the mean time I'm working on a temporary interface class as a
    > stopgap. I'll keep you informed as to my progress.

    Cool, thanks. Meanwhile I've got a workaround - bind the NSBrowser to both
    Content (arrangedObjects) and ContentValues
    (arrangedObjects.representedObject) of the NSTreeController. My NSBrowser
    just came to life!

    I still don't have quite what I wanted - I would have liked not to have to
    bind the NSTreeController to anything, but just to let it prepare content
    internally. When I do the latter, the NSBrowser is populated but its cells
    are blank. So I've had to bind the NSTreeController into my model. Still,
    this is better than nothing. m.

    > On 18 Dec 2007, at 19:38, Matt Neuburg <matt...> wrote:
    >
    >> On Mon, 17 Dec 2007 23:47:39 +0000, "Chris Blackburn"
    >> <cblackburn36...> said:
    >>> Hey all,
    >>>
    >>> Since there was no activity on this I've raised a bug, radar id
    >>> 5649518. Any help on getting round this bug until there is a fix
    >>> would
    >>> be greatly apreciated.
    >>>
    >>> Thanks
    >>>
    >>> Chris
    >>>
    >>> On 12/14/07, Chris Blackburn <cblackburn36...> wrote:
    >>>> Hey all,
    >>>>
    >>>> Part of my app takes an XML input file, hands it to an
    >>>> NSTreecontroller which is bound to an NSBrowser. This works fine
    >>>> under
    >>>> tiger but is broken under leopard.
    >>>>
    >>>> I think I have traced the problem to where the NSBrowsers content is
    >>>> bound to treeController.arrangedObjects. The arrangedObjects binding
    >>>> seems to have changed under leopard, also from the docs I get the
    >>>> impression I was never supposed to use that binding anyway.
    >>
    >> Could I steal this thread to ask a more elementary question? Chris, it
    >> sounds like you can actually help with this so I hope you don't mind
    >> my
    >> piggybacking here.
    >>
    >> All I want to do is make a simple NSBrowser on Leopard (only) using
    >> NSTreeController and NSTreeNode. My NSTreeController's content
    >> object is
    >> bound to an NSTreeNode which itself has a subnode I've given it; the
    >> tree is
    >> created using NSTreeNode treeNodeWithRepresentedObject (my
    >> "represented
    >> objects" are simply strings) and mutableChildNodes, as you would
    >> expect, and
    >> I can see that the tree is being created, and I can see that the
    >> NSTreeController's content is indeed the tree. So things would
    >> appear to be
    >> working from that point of view.
    >>
    >> My problem is that the NSBrowser is not displaying anything when the
    >> app
    >> runs. It's bound to the NSTreeController's arrangedObjects.
    >>
    >> Can someone set me straight? This should be the simplest thing in
    >> the world
    >> to do, so presumably all I need is some kind of dope slap... Please
    >> provide
    >> it! Thx - m.

    --
    matt neuburg, phd = <matt...>, http://www.tidbits.com/matt/
    pantes anthropoi tou eidenai oregontai phusei
    Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
    AppleScript: the Definitive Guide, http://tinyurl.com/2ouo3b
    Take Control of Customizing Leopard, http://tinyurl.com/2t9629
    TidBITS, Mac news and reviews since 1990, http://www.tidbits.com
  • There is still an issue with browsers *if* you set the count key path
    on the tree controller. We hope to fix this in some future update, but
    for now you should be able to bind a browser on Leopard properly if
    you leave out that key. Sorry for the trouble.

    -Beb

    On Dec 18, 2007, at 4:00 PM, David Spooner <dave...>
    wrote:

    > I just tried this and it appears to work (on 10.5).  In addition to
    > binding the browser's content to the tree controller's
    > arrangedObjects, I also bound the browser's contentValues to the
    > tree controller's arrangedObjects with model key path
    > representedObject.  My tree controller's content is bound to a
    > hierarchy of NSTreeNode with strings as represented objects...
    >
    > dave
    >
    > On 18-Dec-07, at 12:38 PM, Matt Neuburg wrote:
    >
    >> On Mon, 17 Dec 2007 23:47:39 +0000, "Chris Blackburn"
    >> <cblackburn36...> said:
    >>> Hey all,
    >>>
    >>> Since there was no activity on this I've raised a bug, radar id
    >>> 5649518. Any help on getting round this bug until there is a fix
    >>> would
    >>> be greatly apreciated.
    >>>
    >>> Thanks
    >>>
    >>> Chris
    >>>
    >>> On 12/14/07, Chris Blackburn <cblackburn36...> wrote:
    >>>> Hey all,
    >>>>
    >>>> Part of my app takes an XML input file, hands it to an
    >>>> NSTreecontroller which is bound to an NSBrowser. This works fine
    >>>> under
    >>>> tiger but is broken under leopard.
    >>>>
    >>>> I think I have traced the problem to where the NSBrowsers content
    >>>> is
    >>>> bound to treeController.arrangedObjects. The arrangedObjects
    >>>> binding
    >>>> seems to have changed under leopard, also from the docs I get the
    >>>> impression I was never supposed to use that binding anyway.
    >>
    >> Could I steal this thread to ask a more elementary question? Chris,
    >> it
    >> sounds like you can actually help with this so I hope you don't
    >> mind my
    >> piggybacking here.
    >>
    >> All I want to do is make a simple NSBrowser on Leopard (only) using
    >> NSTreeController and NSTreeNode. My NSTreeController's content
    >> object is
    >> bound to an NSTreeNode which itself has a subnode I've given it;
    >> the tree is
    >> created using NSTreeNode treeNodeWithRepresentedObject (my
    >> "represented
    >> objects" are simply strings) and mutableChildNodes, as you would
    >> expect, and
    >> I can see that the tree is being created, and I can see that the
    >> NSTreeController's content is indeed the tree. So things would
    >> appear to be
    >> working from that point of view.
    >>
    >> My problem is that the NSBrowser is not displaying anything when
    >> the app
    >> runs. It's bound to the NSTreeController's arrangedObjects.
    >>
    >> Can someone set me straight? This should be the simplest thing in
    >> the world
    >> to do, so presumably all I need is some kind of dope slap... Please
    >> provide
    >> it! Thx - m.
    >>
    >> --
    >> matt neuburg, phd = <matt...>, <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
    >>

previous month december 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