• 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
help with bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

help with bindings


  • Subject: help with bindings
  • From: Rounak Jain <email@hidden>
  • Date: Sun, 21 Nov 2010 09:30:28 +0530

#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 (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Help with Basics (Was: help with bindings)
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: NSExpression is incorrect?
  • Next by Date: Re: NSExpression is incorrect?
  • Previous by thread: Re: NSExpression is incorrect?
  • Next by thread: Re: Help with Basics (Was: help with bindings)
  • Index(es):
    • Date
    • Thread