#import <Cocoa/Cocoa.h> @interface ComboscAppDelegate : NSObject <NSApplicationDelegate> { IBOutlet NSComboBox *countryCombo; NSMutableDictionary *theCountries; NSArray *myKeys; IBOutlet NSWindow *window; } @property (assign) IBOutlet NSWindow *window; - (void)applicationWillFinishLaunching:(NSNotification *)notif; @end
#import "ComboscAppDelegate.h" @implementation ComboscAppDelegate @synthesize window; - (void)applicationWillFinishLaunching:(NSNotification *)notif { theCountries = [[NSMutableDictionary alloc] init]; [theCountries setValue:[NSMutableArray arrayWithObjects:@"AAABBB", @"AABBB", @"AAACCC", nil] forKey:@"A"]; [theCountries setValue:[NSMutableArray arrayWithObjects:@"BBBAAA", @"BBBBBBBB", @"BBBCCC", nil] forKey:@"B"]; [theCountries setValue:[NSMutableArray arrayWithObjects:@"CCCDDD", @"CCFGGGFF", @"CCCDDDFFF", nil] forKey:@"C"]; [theCountries setValue:[NSMutableArray arrayWithObjects:@"T", nil] forKey:@"T"]; myKeys = [[NSArray alloc]init]; myKeys = [theCountries allKeys]; } @end Please tell me the binding connections I must make so that I see the Keys of "theCountries" (i.e. myKeys) in the drop-down of countryCombo. I tried using NSArrayController but could not get it right. Please guide me. (Also, is there a way to reduce the four theCountries setValue: statements to one?) _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com