Table View, Combo Box, Data Sources, and call methods. Please Help!

I am having trouble doing the following:

I have a table with several columns and I’m trying to populate a combo box in the table view from an external data source. I’ve had not problems populating the table with a data source, except the combo box shows a strait list instead of a drop down menu list.

I’ve tried the combo box with and without a data source and I’ve tried manipulating it with call methods removeAllItems and addItemsWithTitles: without luck.

I have also tried the call methods setDataSource: with numberOfRowsInTableView: and tableView:objectValueForTableColumn:row: with a reloadData, but that hasn’t worked.

I’m not that familiar with call methods or Objective-C, so I’ve had a bit of a learning curve trying to put them together. Or should I say, I have lots of bumps and band aids on my head and my desk hates me. :mad: I’ve looked into several books, I’ve searched this forum and apples mailing list, cocoa dev central and a slew of other sites. I learned a lot, but I didn’t solve my problem, so here I am.

I essentially have a list of records with some records containing a list. This would be and example of one list:
{name:“gumby”, friend:“pokey”, comboBoxList:{“yadda”, “ying”, “yang”}}

and I have a list of lists like this.

I know you can’t use a data source with combo boxes in table view, so I was hoping someone may know how I can put together some call methods to achieve my goal of loading these lists of records which also contain lists. I’ve seen some cocoa or objetive-c examples, but most are over my head. I suppose I could learn more and create my own class, but I’m hoping I haven’t reached that point yet. Any help will be greatly appreciated.

I hope I understood: You want to have individual menues for every row in your comboBox cells?

Since the ‘normal’ behaviour of a table column is, that it provides an identical cell for every row (with identical menues), I think you should create an NSTableColumn sublass and use it for your comboBox cell column. In this subclass you override this method: - (id)dataCellForRow:(int)row with a custom method that returns an individual comboBox cell for every row - with an individual menu. For this it needs an NS(Mutable)Array containing the cells for all rows and method(s) to influence the menu of these cells from outside (call method “…” of myComboBoxColumn).

For a similar (but less complicated) example read this thread: http://bbs.applescript.net/viewtopic.php?id=17903

D.

Yes, I want different values for the comboBox for every row of the table column. Thanks for the advice and tip on some example code. Now I’ll have to go back to the drawing board and see what I can come up with. I never thought it would get so complicated. :lol: