#import <Cocoa/Cocoa.h>

int
main()
{
  NSAutoreleasePool *pool;
  NSString *string;
  NSTextView *textView;

  pool = [NSAutoreleasePool new];
  [NSApplication sharedApplication];
  textView = [NSTextView new];
  [textView setString: @"This is the first string"];
  string = [textView string];
  NSLog(@"string (1) = %@", string);
  [textView replaceCharactersInRange: NSMakeRange (12, 5)
                          withString: @"second"];
  NSLog(@"string (2) = %@", string);
  NSLog(@"string (3) = %@", [textView string]);
  if ([string isEqualToString: [textView string]])
    printf("No copy\n");
  else
    printf("Copy\n");
  [textView release];
  [pool release];
  return 0;
}
