NSOutlineView problem with Lion

Discussion in 'Mac Programming' started by SpartanTom, May 16, 2012.

  1. SpartanTom, May 16, 2012
    Last edited: May 16, 2012

    SpartanTom macrumors newbie

    May 16, 2012
    Buffalo, NY, USA
    Hi folks,

    I'm an experienced developer (on other platforms) who's just starting to take over some Mac development duties at my small company.

    I've inheirited an enormous (and unfortunately bug-ridden) code base for our company's in-house relational database frontend. Unfortunately, right when I took over the project, we started a Lion rollout, and I've discovered a vexing issue that only shows up on Lion systems.

    I have attached four screenshots, before and afters of opening and closing up parent items (hope I have my terminology right) in an NSOutlineView. This is the same application, running on my Snow Leopard machine and our head of purchasing's brand new Lion system.

    As you can see, on the Lion system, something goes wrong when the parent items are opened and the child line is not correctly displayed. Oddly, our application is full of OutlineViews, and this is the only one exhibiting this behavior, and only on Lion systems. The only difference I could find is that when I check out those OutlineViews in InterfaceBuilder, the problem one is a "Row Resizable Outline View." Is that a standard UI component, or did one of our previous in-house devs create that?

    I appreciate your time and attention to this message -- I know I probably haven't given enough information for anyone to figure out what's going on, but pointers in the right direction or requests for additional information would be most welcome.

    Thanks very much in advance!

    PS - It would appear my attachments disappeared after posting. Hopefully these links will be allowed through:

  2. SpartanTom thread starter macrumors newbie

    May 16, 2012
    Buffalo, NY, USA
    Found problem

    Just of the sake of google and archive searched, just wanted to note that the RowResizableOutlineView is not a standard Apple UI component -- see http://www.evanjones.ca/software/osx-tableview.html. I have switched back to the standard NSOutlineView for that area of our Database in the short term. It's a very low priority on my list of bugfixes, but if I ever get the RowResizables working on Lion again, I'll follow up here.

  3. Sydde macrumors 68020


    Aug 17, 2009
    It actually is a standard feature of NSTableView (of which NSOutlineView is a subclass) since about 10.5. To do it yourself, you have to have a NSTableView delegate for the outline view, in which you implement -tableView:heightOfRow:. How Evan Jones shoehorned it into the datasource I have not investigated, but that could be the reason for the Lion bug.

    Remember that this method will get called frequently, so it should have a very quick way to determine how tall to make the row, perhaps a value cached in the datasource array, to which it should have direct access (datasource and delegate are often the same object).

    On a side note, it is unfortunate the Evan Jones used the word "resizable" in his object, because that leads to confusion: "resizable" usually implies the the user has some control over sizing, the more appropriate term would have been "variable height" or something like that.

Share This Page