Help with Table View

I have yet to get a table view to work properly. I’m trying to create a table view that contains data from the address book. The following code works in so much as it causes no errors, but when it’s done, none of the data is in the table.

property addressbookData : {}

on awake from nib theObject
	if name of theObject is "nameTblVw" then createNameDatasource(theObject)
end awake from nib

on createNameDatasource(theObject)
	tell application "Address Book"
		set addressbookData to properties of every person
	end tell
	say "got data"
	-- Create the data source; this places it in the application
	--  object's data source elements. (Assign it to table view below.)
	set theDataSource to make new data source at end of data sources with properties {name:"names"}
	
	say "created data source"
	-- Create each of the data columns, including the sort information
	--   for each column
	make new data column at end of data columns of theDataSource with properties {name:"name", sort order:ascending, sort type:alphabetical, sort case sensitivity:case sensitive}
	say "created column"
	-- Make this a sorted data source
	set sorted of theDataSource to true
	say "set sorted"
	-- Set the "name" data column as the sort column
	set sort column of theDataSource to data column "name" of theDataSource
	say "set name sort"
	-- Set the data source of the table view to the new data source
	set data source of theObject to theDataSource
	say "set data source"
	-- Add the table data (using the new "append" command)
	append theDataSource with addressbookData
	say "appended source"
end createNameDatasource

(I put the say lines in to let me know that the entire handler was being executed).
The nib file has a table view named “nameTblVw” inside a scroll view named “nameScrlVw” and containing a column called “name”. By everything I know, this should work.

I need a second pair of eyes to tell me what (probably obvious) point I’m missing.

Have you looked at the table view examples yet?

Also: Use breakpoints instead of “say”.

Yes, I looked at them, even used the same code as the example. That’s why I can’t understand what’s happening.

As for the breakpoints, sometimes they’re helpful, but for this exercise the debugger isn’t telling me anything I don’t already know. The data is in addressbookData and the debugger doesn’t show me the datasource at all. I’ve just found it faster to use “say” when I’m working, the debugger takes more time than a quick execution does.

OK, I found the problem…the darned vertical bar characters in the example around “name” escaped my notice. I know that they protect identifier names so they can have any character, but in this case I think they keep “name” from being interpreted as a property of some object.

Just goes to show ya–there are no unimportant details.

Thanks Mikey, you got me to go back and re-look at the example.