Skip to content

Instantly share code, notes, and snippets.

@NYiPhoneDeveloper
Created September 14, 2010 21:41
Show Gist options
  • Save NYiPhoneDeveloper/579826 to your computer and use it in GitHub Desktop.
Save NYiPhoneDeveloper/579826 to your computer and use it in GitHub Desktop.
#import <Foundation/Foundation.h>
int main (int argc, const char *argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSMutableArray *collectionArray = [[NSMutableArray alloc] init];
NSArray *numArray = [[NSArray alloc] init];
NSArray *strArray = [[NSArray alloc] init];
numArray = [NSArray arrayWithObjects: @"1", @"2", @"3", @"4", @"5", nil];
strArray = [NSArray arrayWithObjects: @"One", @"Two", @"Three", @"Four", @"Five", nil];
[collectionArray addObject: numArray];
[collectionArray addObject: strArray];
NSMutableDictionary *cD = [[NSMutableDictionary alloc] init];
cD = [NSMutableDictionary dictionaryWithObjects: strArray forKeys: numArray];
NSString *str = [cD objectForKey: @"1"];
NSLog (@"%@\n", str);
[cD release];
[strArray release];
[numArray release];
[pool drain];
return 0;
}
/*
NSMutableDictionary *dOne = [[NSMutableDictionary alloc] init];
dOne = [NSMutableDictionary dictionaryWithObjectsAndKeys: @"One", @"1", @"Two", @"2", @"Three", @"3", nil];
NSString *myStr;
myStr = [dOne objectForKey: @"2"];
NSLog (@"%@", myStr);
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment