The Strange Case of the Disappearing Table View

  • Hello,

    I have a sheet in my app that contains an NSTabView which in turn contains an NSTableView. Something very curious is happening. Whenever I bring up the sheet, everything looks fine. But if I try to select a row in the table view, the table view disappears. In fact, it's not only the table view that disappars - the whole tab view disappears and I'm just left with an empty sheet with a couple of buttons on it. In fact the sheet makes no difference to anything - I just tried running this as a normal panel, and still this happens.

    Note that this only happens when a row gets selected.

    Has anybody experienced anything similar? What on earth is going on?

    Many thanks in advance,
    Keith
  • Am 29.10.2006 um 16:11 schrieb Keith Blount:
    > I have a sheet in my app that contains an NSTabView which in turn
    > contains an NSTableView. Something very curious is happening.
    > Whenever I bring up the sheet, everything looks fine. But if I try
    > to select a row in the table view, the table view disappears. In
    > fact, it's not only the table view that disappars - the whole tab
    > view disappears and I'm just left with an empty sheet with a couple
    > of buttons on it. In fact the sheet makes no difference to anything
    > - I just tried running this as a normal panel, and still this happens.

      Maybe you're doing something odd in the table view delegate? Or are
    you creating any of this in code? Are you perhaps over-releasing an
    object? I personally haven't heard of something like that, except in
    one case: When I was accidentally accessing views from a thread other
    than the main thread.

    Cheers,
    -- M. Uli Kusterer
    http://www.zathras.de
  • Thank you very much for your reply. I think I have this solved - sort of. It seems that I had been bitten by a strange .nib file bug - the third of the kind I have been bitten by in the same project (which is a big project and all bugs were in different .nib files). I copied the contents of the NSPanel in the .nib - table view, tab view and all - and pasted it into a fresh NSPanel in the same .nib. Then I deleted the original panel. The bug has now magically gone away. Recently I also had a bug whereby my app would crash if the user tried to drag the search field toolbar item from the customisation palette to the toolbar, and the crash traces indicated that this was caused by the NSMenu used for the search menu template. When I deleted the NSMenu from the .nib file and re-created it (identically), this crashing bug went away. And I also had a problem in another .nib file where the scroll buttons of a scroll view ceased to work (and mouse scrolling didn't work either). When I deleted the NSScrollView and re-created it in exactly the same way, everything worked fine. So it seems that .nib files can become a bit dodgy in some cases... Weird, but at least everything seems okay now.

    Thanks again for taking the time to reply.
    All the best,
    Keith

    ----- Original Message ----
    From: Uli Kusterer <witness.of.teachtext...>
    To: Keith Blount <keithblount...>
    Cc: <cocoa-dev...>
    Sent: Sunday, October 29, 2006 7:22:35 PM
    Subject: Re: The Strange Case of the Disappearing Table View

    Am 29.10.2006 um 16:11 schrieb Keith Blount:
    > I have a sheet in my app that contains an NSTabView which in turn
    > contains an NSTableView. Something very curious is happening.
    > Whenever I bring up the sheet, everything looks fine. But if I try
    > to select a row in the table view, the table view disappears. In
    > fact, it's not only the table view that disappars - the whole tab
    > view disappears and I'm just left with an empty sheet with a couple
    > of buttons on it. In fact the sheet makes no difference to anything
    > - I just tried running this as a normal panel, and still this happens.

      Maybe you're doing something odd in the table view delegate? Or are
    you creating any of this in code? Are you perhaps over-releasing an
    object? I personally haven't heard of something like that, except in
    one case: When I was accidentally accessing views from a thread other
    than the main thread.

    Cheers,
    -- M. Uli Kusterer
    http://www.zathras.de
previous month october 2006 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