Need help with table and NS button cell

Hello all, I recently purchased Shanes book and have learned a lot. However I am stuck with a problem. In my table, I have 5 fields. I can currently populate 2 of the 5 fields using the following code. However I have 3 more fields that I am strugling with.

		
tell application id "com.apple.systemevents"
set theNames to name of files of theFolder
set theSizes to physical size of file of theFolder
end tell

repeat with i from 1 to count of theNames
	set end of tempList to {theName:item i of theNames, theSize:item i of theSizes}
end repeat



1 is a NSpopupbuttoncell that I need to to populate with 4 menu items curing table population. The other 2 cells are NSbuttonCells that I need to have a action tied to. Problem is that they don’t look to be enabled when the table is populated even tho they are in the xib file.

I don’t quite follow. Are the popup and buttons two separate problems? If so, could you describe them separately, and in a bit more detail?

Yes, it was two different problems. I have eliminated one of the problems. The problem I am left with is as follows.

I have a add button. When clicked it allows you to choose a graphic file and the table is populated with a row that has columns for Filename, quantity and substrate. The substrate field is a popupbuttoncell.

My problem is that when the row is added, the popupbuttoncell is their, but I can’t click on it. Like it has no values. The values of the popupbutton cell are in a list declaired as a property

property materialValues : {"Substrate1", "Substrate2", "Substrate3", "Substrate4", "Substrate5"}

I have this cell bound to my Array Controller in Content Values and my model key path is materialValues

I hope this helps.

OK, I figured out how to get the popupbuttoncells to have the values, but now when I click on one, it shows the options in the menu but it wont change when I select a new one.

That sounds like there could be a problem with your binding of that column. How is that set up?

in interface builder I have
Array Controller is bound to app delegate with model key path of theData
Pop up button cell is bound to app delegate with model key path of materialValues

In xcode i have


	property theData : {}
	property theArrayController : missing value
	property materialValues : {"one", "two", "three", "four", "five"}

	on populateTable_(sender)
		set theFolder to choose folder with prompt "Pick a folder"
		tell application id "com.apple.systemevents"
			set theNames to name of files of theFolder whose visible is true
		end tell
		set tempList to {}
		repeat with i from 1 to count of theNames
			set end of tempList to {theName:item i of theNames, theQuantity:missing value, theDate:missing value}
		end repeat
		tell theArrayController to addObjects_(tempList)
	end populateTable_

But how is the column containing the popup bound to the array controller?

well that may be my problem, it isn’t bound to anything. :stuck_out_tongue: