NSComboBox w/ DataSource
NSComboBox w/ DataSource
- Subject: NSComboBox w/ DataSource
- From: Thomas Hudson <email@hidden>
- Date: Sat, 2 Jun 2001 14:01:12 -0700
I'm trying to use a data source with an NSComboBox. I've made
connections for
action and data source to my combo box, and set the attributes of the
combo box
to use a data source. In my data source object I implement:
- (int)numberOfItemsInComboBox:(NSComboBox *)aComboBox;
- (id)comboBox:(NSComboBox *)aComboBox
objectValueForItemAtIndex:(int)index;
When I run the app in the debugger I can see that
numberOfItemsInComboBox is
being called (four times, I believe) before the window appears. When I
click on the
CB button for the drop down, the program crashes with EXC_BAD_ACCESS in
numberOfIemsInComboBox. Moments later PB crashes.
I've made the assumption that my data source can be instantiated in the
nib. At
least it seems this is working, since the appropriate message is being
called.
Are there any examples around of using an NSComboBox with a data source?
Thomas