Help with SpeakLine app from Hilllegass' book

Discussion in 'Mac Programming' started by HawaiiMacAddict, Oct 23, 2008.

  1. HawaiiMacAddict macrumors 6502a

    Joined:
    Dec 28, 2006
    Location:
    On one of my Macs of course
    #1
    Aloha everyone,

    I just bought a new MBP, so I'm going through Aaron Hillegass' book on Cocoa programming again, recreating the projects again. Hopefully this will help to reinforce the concepts.

    I have come across a rather strange, at least to me, issue with the SpeakLine app from Chapter 6. I put a Table View on my nib file, but can not connect the tableView outlet from the class instance to the actual table view in my nib, as shown in the screenshots (the second was taken after the unsuccessful drag-and-drop attempt). I can drag from the connections panel, but once I get to the table view, nothing happens. I really don't understand what is (not) going on here.

    Thanks in advance for any assistance provided.

    HawaiiMacAddict
     

    Attached Files:

  2. HiRez macrumors 603

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #2
    It looks to me like maybe you are trying to connect it to the NSScrollView which wraps the NSTableView instead of the table view itself, or you haven't declared it as the right type. When you declare it in your app controller, does it look like this?
    Code:
    IBOutlet NSTableView *tableView;
    When you drag to a valid object for the connection, it should highlight it with a dark blue border line and I don't see that on your screen shot. So it looks like maybe it either doesn't know it's supposed to be looking for an NSTableView, or your mouse is not positioned over it correctly. Sometimes with these hierarchical view structures, you need to mouse around over the object until it find the right object inside.

    One thing to try would be putting your IB .xib view into list mode and dragging to the table view there instead of hunting for it in the interface. That way you know which object you are dragging to. (screen shot attached).

    Picture 5.png
     
  3. HawaiiMacAddict thread starter macrumors 6502a

    Joined:
    Dec 28, 2006
    Location:
    On one of my Macs of course
    #3
    Aloha HiRez,

    Thanks for your assistance, but still no joy. I'm probably just going to start over on this project from scratch after I get home tonight.

    HawaiiMacAddict
     
  4. crackpip macrumors regular

    Joined:
    Jul 23, 2002
    #4
    Is it possible you have a typo in your AppController header file or a missing semi-colon? If you, for example, put `IBOutlet NSTableVeiw *tableView;` within Interface Builder you wouldn't be able to make the connections.

    crackpip
     
  5. HawaiiMacAddict thread starter macrumors 6502a

    Joined:
    Dec 28, 2006
    Location:
    On one of my Macs of course
    #5
    Aloha again,

    I feel like a complete dolt now - there was indeed an 'issue' with my declaration in the header file. I must have just been a bit antsy for Game 2 of the World Series, wanting to see my Rays beat the Phillies :D Anyway, everything is good now and I'll make sure not to trust the Tab key too much again in the future. Don't get me wrong - I really like the autocompletion feature, but sometimes it can get me in trouble. Thanks again for your help.

    HawaiiMacAddict
     

Share This Page