#import <Foundation/Foundation.h>

int main()
{
	NSAutoreleasePool *pool=[NSAutoreleasePool new];

	NSString *string=[[NSString alloc] initWithUTF8String:"test"];
	NSValue *value1=[NSValue valueWithNonretainedObject:string];

	printf("%s\n",[[value1 description] UTF8String]);

	[string release];

	printf("%s\n",[[value1 description] UTF8String]); // Crashes!

	NSMutableArray *array=[NSMutableArray array];
	NSValue *value2=[NSValue valueWithNonretainedObject:array];

	printf("%s\n",[[value2 description] UTF8String]);

	[array addObject:value2];

	printf("%s\n",[[value2 description] UTF8String]); // Crashes!
}

