Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

HawaiiMacAddict

macrumors 6502a
Original poster
Dec 28, 2006
904
0
On one of my Macs of course
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
 

Attachments

  • Picture 1.png
    Picture 1.png
    363 KB · Views: 109
  • Picture 2.png
    Picture 2.png
    369.4 KB · Views: 120

HiRez

macrumors 603
Jan 6, 2004
6,265
2,630
Western US
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
 

crackpip

macrumors regular
Jul 23, 2002
210
0
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
 

HawaiiMacAddict

macrumors 6502a
Original poster
Dec 28, 2006
904
0
On one of my Macs of course
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.