CocoaDev

Edit AllPages

NSComboBox Data Source - Populate NSComboBox from text file.

Basically, I want to populate an NSComboBox with the data from a text file. The code I have is:

The text file looks something like this:

dataItem1 dataItem2 dataItem3 …. etc

I have a button set to run the method “populate” when it is pressed, but … it literally does nothing. Any help pointing me in the right direction would be greatly appreciated.

Thanks, Jason


Hm, I think setUsesDataSource should be NO.


Use the debugger, do some legwork. You can get far more specific than “it literally does nothing”. Step through the method line by line, see where it’s going wrong. Not only will you be able to give us more information, but you’ll probably find out enough to solve the problem on your own.