Data Source variable not defined

Hey,
I have been attempting my first use of a table and data source pair in XCode 3.0.

I followed the example in the developer documentation. When I run my code, I get the error listed in the subject

The only difference I can find is that the example has a data source object in Interface builder. It seems that there is no data source object in v3 of XCode.

Any help appreciated.

Dee

Um, show us your code so we can advise :wink:

Yes, Apple seems to have changed the “recommended” method of creating a data source to do it programmatically. You can still do it in IB by modifying a generic NSObject, but it’s not recommended. Instead, you do this:

set myDataSource to make new data source at end in data sources
set data source of table view "My Table" to myDataSource

Tom
BareFeet
http://www.tandb.com.au

Sorry about the missing code, I was thinking that it was something I was missing in IB.

first this is in my “On opened” event handler:

set ListDS to make new data source at end of dataSources with properties {name:"filesDataSource"}

Then later on when the window with the table is brought up…

set ListDS to data source of table view "CFFileTable" of scroll view "CFFileScroll" of the window "CFListwin"
--add coloumns to the data source
	tell ListDS
		make new data column at the end of the data columns with properties {name:"Delete"}
		make new data column at the end of the data columns with properties {name:"Name"}
		make new data column at the end of the data columns with properties {name:"Path"}
		make new data column at the end of the data columns with properties {name:"date"}
	end tell

Thanks
Dee

Your second line just redefines what ListDS is, so should be around the ather way, ie:

set data source of table view "CFFileTable" of scroll view "CFFileScroll" of the window "CFListwin" to ListDS

Tom
BareFeet
http://www.tandb.com.au

Thanks, that was what I did wrong.

dee