ftp.nice.ch/pub/next/developer/objc/preferences/DefaultsExample.NIHS.s.tar.gz#/DefaultsExample/FmsStringPair.m

This is FmsStringPair.m in view mode; [Download] [Up]

//  FmsStringPair
//
//  Copyright 1994  Flying Monkey Software
//                  8424 Todd Creek Cr. WestChester OH 45069
//
//  This code is distributed as shareware. If you like it or use it, please
//  send an appropriate amount of money (one dollar is suggested) to the
//  above address.
//
//  Modification is cool by us, as well as inclusion of this code in a
//  for-profit product in compiled form. However, Flying Monkey Software
//  retains all copyrights; you are hereby not given permission to resell
//  this code in code form without written consent of Flying Monkey.

#import "FmsStringPair.h"

@implementation FmsStringPair

- free
	{
	if (first != NULL)
		{
		free(first);
		first = NULL;
		}
	if (second != NULL)
		{
		free(second);
		second = NULL;
		}
	return [super free];
	}
	

- setFirst:(char *)newFirst
	{
	char *value;
	if (first != NULL)
		{
		free(first);
		first = NULL;
		}
	strcpy((value = (char *)malloc(strlen(newFirst)+1)),newFirst);
	return [super setFirst:value];
	}


- setSecond:(char *)newSecond
	{
	char *value;
	if (second != NULL)
		{
		free(second);
		second = NULL;
		}
	strcpy((value = (char *)malloc(strlen(newSecond)+1)), newSecond);
	return [super setSecond:value];
	}

@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.