#include <stdio.h>
#import <Foundation/Foundation.h>

int
main()
{
    NSAutoreleasePool *pool = [NSAutoreleasePool new];
    NSMutableData *data;
    NSKeyedArchiver *aCoder;

    printf("Creating archive1 ...\n");
    data = [NSMutableData data];
    aCoder = [[NSKeyedArchiver alloc] initForWritingWithMutableData: data];
    [aCoder encodeInt: 42 forKey: @"A"];
    [aCoder encodeFloat: 42 forKey: @"B"];
    [aCoder finishEncoding];
    [aCoder release];
    [data writeToFile: @"archive1" atomically: YES];

    printf("Creating archive2 ...\n");
    data = [NSMutableData data];
    aCoder = [[NSKeyedArchiver alloc] initForWritingWithMutableData: data];
    [aCoder encodeFloat: 42 forKey: @"A"];
    [aCoder encodeInt: 42 forKey: @"B"];
    [aCoder finishEncoding];
    [aCoder release];
    [data writeToFile: @"archive2" atomically: YES];

    printf("Done\n");
    [pool release];
    return 0;
}
