mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-26 10:11:03 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3496 72102866-910b-0410-8b05-ffd578937521
41 lines
1 KiB
Objective-C
41 lines
1 KiB
Objective-C
#include <base/all.h>
|
|
#include <Foundation/NSAutoreleasePool.h>
|
|
|
|
int main()
|
|
{
|
|
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
|
id dict = [Dictionary new];
|
|
|
|
id translator = [Dictionary new];
|
|
id mc;
|
|
|
|
[dict putObject:@"herd" atKey:@"cow"];
|
|
[dict putObject:@"pack" atKey:@"dog"];
|
|
[dict putObject:@"school" atKey:@"fish"];
|
|
[dict putObject:@"flock" atKey:@"bird"];
|
|
[dict putObject:@"pride" atKey:@"cat"];
|
|
[dict putObject:@"gaggle" atKey:@"goose"];
|
|
[dict printForDebugger];
|
|
printf("removing goose\n");
|
|
[dict removeObjectAtKey:@"goose"];
|
|
[dict printForDebugger];
|
|
|
|
[translator putObject:@"cow" atKey:@"vache"];
|
|
[translator putObject:@"dog" atKey:@"chien"];
|
|
[translator putObject:@"fish" atKey:@"poisson"];
|
|
[translator putObject:@"bird" atKey:@"oisseau"];
|
|
[translator putObject:@"cat" atKey:@"chat"];
|
|
|
|
mc = [[MappedCollector alloc] initWithCollection:dict map:translator];
|
|
[mc printForDebugger];
|
|
|
|
[mc release];
|
|
[dict release];
|
|
[translator release];
|
|
|
|
[arp release];
|
|
exit(0);
|
|
|
|
}
|
|
|
|
|