NSComboBox Delegate problem
NSComboBox Delegate problem
- Subject: NSComboBox Delegate problem
- From: dan donaldson <email@hidden>
- Date: Sat, 5 Jun 2004 14:14:33 -0400
I have a class that acts as datasource and delegate to two NSComboBoxes.
When the user selects an item in the NSComboBox #1, a lookup is
performed in a dictionary using the value from the combobox and the
result is intended to determine the value of the second. Here is the
code:
- (void) comboBoxSelectionDidChange:(NSNotification *)aComboBox
{
NSDictionary * tempDict = [CDCchannelDict objectForKey:[[aComboBox
object] stringValue]];
NSLog(@"string value of aComboBox is %s",[[[aComboBox object]
stringValue] UTF8String]);
NSString * channelToShow = [tempDict objectForKey:@"channel"];
NSLog(@"set channel to %s", [channelToShow UTF8String]);
}
The problem is, the NSLog in the fourth line shows me that the value is
actually the value that the combobox had >before< the change. As a
result, data is retrieved fine, but for the wrong key. I know that this
isn't a bug but my newbie ignorance. What am I doing wrong?
BTW, this is done in a way that does not involve any new entries added
to the NSComboBox - I'm simply selecting from entries that are already
there.
dan donaldson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.