question about table view

topic posted Sun, December 9, 2007 - 6:15 PM by  hoco
I'm very new to cocoa and objective C. I'm hoping someone can shed some light on how to use the TableView.

I actually have gotten a TableView to display (sort of) in my tiny, new application. But, the values are always empty. It has the right number of rows, but my implementation of objectValueForTableColumn: always gets nill for [tc identifier], which doesn't make any sense to me. It should have the names of the columns I identified like this:

[myTable tableColumnWithIdentifier:@"Percent"];

Am I supposed to do something special in interface builder to identify the outlet for each column in the TableView object? Or, am I supposed to do something in interface builder to assign the same names there that I did with my tableColumnWithIdentifier call?

My array of objects has data, and the objectValueForTableColumn method is getting called when it should, but until [tc identifier] tells me a column identifier, I won't be able to return data for the column.

Thanks for any useful help you can provide.
posted by:
hoco
SF Bay Area
  • Re: question about table view

    Mon, December 10, 2007 - 8:08 PM
    OK, I finally found the answer by looking in detail at how one of the examples (PubSub/NewsReader) was created. What I was missing was going into the "Table Column Attributes" tab for each of the columns in my table view and entering a string for the "identifier" field. This then becomes the identifier for the column, which shows up in the [tc identifier] call.

Recent topics in "COCOA"

Topic Author Replies Last Post
is this tribe active? hoco 2 February 8, 2008
Xcode 3.0 0 November 28, 2007
Webcam image capture? Sean 0 June 20, 2005