NSComboBoxDataSource problems
NSComboBoxDataSource problems
- Subject: NSComboBoxDataSource problems
- From: "Allen Curtis" <email@hidden>
- Date: Tue, 26 Aug 2008 09:12:21 -0700
Hello,
I am not sure how to categorize this problem so I will just explain the circumstance.
I am writing my first Cocoa application and I am trying to dynamically fill a ComboBox. In order to do this I implemented the required methods in my UiController implementation as follows:
- (NSInteger)numberOfItemsInComboBox:(NSComboBox *)aComboBox
{
return 3;
}
- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(NSInteger)index
{
NSArray *text = [NSArray arrayWithObjects: @"Jazz", @"Acid", @"Funk", nil];
printf("Get index %d\n", index);
return [text objectAtIndex:index];
}
When I run the program the console displays the message:
2008-08-26 08:59:46.417 CSAFEApp[14163:10b] *** Illegal NSComboBoxCell data source (<MyController: 0x134360>). Must implement numberOfItemsInComboBoxCell: and comboBoxCell:objectValueForItemAtIndex:
In preparation of this email, I created a new Cocoa project which contained a window with a single combobox and a UiController. The above code works in the simple project!
Now I am completely confused. My suspicion is that there is lingering garbage in one of the project files. To work around this I tried to create a brand new controller class, made the datasource connections in the Interface Builder and got the same results. I also tried a build clean all with no luck.
What can I do to diagnose and fix this problem?
Thanks
Allen
PS: The version of Xcode and Interface Builder are 3.1
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden