• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSComboBox Delegate problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Prev by Date: framework
  • Next by Date: Re: Representing UTC time in a readable format
  • Previous by thread: framework
  • Next by thread: RE>NSComboBox Delegate problem
  • Index(es):
    • Date
    • Thread