Okay, I'm very close to pitching my Mac out of a Window in frustration here. So I'm kind of hoping that someone knows the answer and can save a perfectly good computer from being smashed on the pavement.
Here's the situation:
I want to add a list control to a window. So I figured on using NSTableView. And I've been fighting with it for eight hours trying to get it to do ANYTHING. Every example/tutorial I've been able to find online basically consists of this:
1. Drop the NSTableView onto the Window in IB
2. Create a controller class for it derived from NSObject, instantiate and hook up the dataSource outlet for the NSTableView to it
3. Create the source files and add the numberOfRowsInTable and tableViewbjectValueForTableColumn:row member functions to the controller class
4. Create an array in the controller class and return appropriate values from both of the above members
Now, let me be absolutely clear about this: these four steps DO NOT result in a working NSTableView. The controller class is instantiated at run time. Its init function is called, the array is populated. Neither numberOfRowsInTable nor tableViewbjectValueForTableColumn:row are ever called. Calling reloadData on the NSTableView manually does absolutely nothing.
I don't know if every writer of an example or tutorial is on crack, or if there's something they're keeping to themselves so that they can giggle at my frustration, but something critical IS missing here, because the code simply doesn't work.
Can someone PLEASE tell me what it is that I need to do (or not do) to make this work? If I need to give Steve Jobs sexual favours, that's fine. If I need to give YOU sexual favours, I'm sure that's doable. But seriously... this is ridiculous. I know this control works, since Apple uses it in its own apps, but I haven't been able to find a single piece of source code that demonstrates how to make it work myself.
Here's the situation:
I want to add a list control to a window. So I figured on using NSTableView. And I've been fighting with it for eight hours trying to get it to do ANYTHING. Every example/tutorial I've been able to find online basically consists of this:
1. Drop the NSTableView onto the Window in IB
2. Create a controller class for it derived from NSObject, instantiate and hook up the dataSource outlet for the NSTableView to it
3. Create the source files and add the numberOfRowsInTable and tableViewbjectValueForTableColumn:row member functions to the controller class
4. Create an array in the controller class and return appropriate values from both of the above members
Now, let me be absolutely clear about this: these four steps DO NOT result in a working NSTableView. The controller class is instantiated at run time. Its init function is called, the array is populated. Neither numberOfRowsInTable nor tableViewbjectValueForTableColumn:row are ever called. Calling reloadData on the NSTableView manually does absolutely nothing.
I don't know if every writer of an example or tutorial is on crack, or if there's something they're keeping to themselves so that they can giggle at my frustration, but something critical IS missing here, because the code simply doesn't work.
Can someone PLEASE tell me what it is that I need to do (or not do) to make this work? If I need to give Steve Jobs sexual favours, that's fine. If I need to give YOU sexual favours, I'm sure that's doable. But seriously... this is ridiculous. I know this control works, since Apple uses it in its own apps, but I haven't been able to find a single piece of source code that demonstrates how to make it work myself.