Small problem with NSTableView

Discussion in 'Mac Programming' started by Macaddicttt, Jan 24, 2008.

  1. macrumors 6502a

    Macaddicttt

    Joined:
    Apr 22, 2004
    Location:
    San Diego, CA
    #1
    I searched for this, but I didn't find anything, so please excuse me if this has been answered before.

    I'm working my way through Hillegass's Cocoa Programming for OS X, and I've run into a little snafu. In a custom class, I've created an IBOutlet of type NSTableView:

    Code:
    IBOutlet NSTableView *tableView;
    but when I try and connect it to an NSTableView in Interface Builder, it says I can't because "tableView must be of type NSTableView, which makes no sense because it most definitely is. I've double-checked my typing a million times, and I know I didn't mess that up. I've just been copying right out of the book, yet I can't get rid of this problem.

    Any help would be very much appreciated. The best I can figure is that something in OS X has changed between when the book was written and 10.4, which is what I'm running now.
     
  2. macrumors 6502

    Joined:
    Jun 1, 2006
    #2
    I would check you are actually hitting the NSTableView when making the connection. An NSTableView has many other views inside it that you may be hitting, such as NSTableColumn
     
  3. thread starter macrumors 6502a

    Macaddicttt

    Joined:
    Apr 22, 2004
    Location:
    San Diego, CA
    #3
    That was it! Thanks a lot. It's quite ridiculous how difficult it is to hit NSTableView. NSTableColumn takes up most of it, the title and scroll bar is NSScrollView, but the very, very edge of the whole thing is NSTableView.

    Although I still feel like an idiot for not catching that... :eek:
     
  4. macrumors 601

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #4
    Yes, one of my biggest complaints about Interface Builder. Is it any better in the Leopard version than in Tiger? They should have a hierarchical outline view like they do under the Classes tab, but only for objects that are in the current document. Then you could just click on "My Table View" (or whatever) directly to select it no matter how deeply it was buried, or more easily multi-select objects.
     
  5. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #5
    It is slightly easier to work with, but they do have a hierarchical view:
     

    Attached Files:

  6. macrumors 601

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #6
    Oh man, nice! I've been holding off on upgrading to Leopard because my work won't upgrade yet (big company beauracracy + IT security paranoia), but the new dev tools and Time Machine are making it hard to wait. Thanks for the pic.
     
  7. macrumors newbie

    Joined:
    May 29, 2009
    #7
    In Xcode old version you can navigate the hierarchical tree like this:
     

    Attached Files:

Share This Page