|
|
Sample Programs from NeXSTEP 3.3
/*--------------------------------------------------------------------------
*
* You may freely copy, distribute, and reuse the code in this example.
* SHL Systemhouse disclaims any warranty of any kind, expressed or
* implied, as to its fitness for any particular use.
*
* Publisher
*
* Inherits From: NSObject
*
* Conforms To: None
*
* Declared In: Address.h
*
*------------------------------------------------------------------------*/
#import "Address.h"
#import <foundation/NSString.h>
@implementation Address
/*--------------------------------------------------------------------------
* Init and Dealloc
*------------------------------------------------------------------------*/
- init
{
[super init];
return self;
}
- (void) dealloc
{
[address autorelease];
[city autorelease];
[state autorelease];
[zip autorelease];
[super dealloc];
}
/*--------------------------------------------------------------------------
* Accessors
*------------------------------------------------------------------------*/
- (NSString *) address
{
return address;
}
- (NSString *) city
{
return city;
}
- (NSString *) state
{
return state;
}
- (NSString *) zip
{
return zip;
}
- (void) setAddress: (NSString *)anAddress
{
[address autorelease];
address = [anAddress retain];
}
- (void) setCity: (NSString *)aCity;
{
[city autorelease];
city = [aCity retain];
}
- (void) setState: (NSString *)aState
{
[state autorelease];
state = [aState retain];
}
- (void) setZip: (NSString *)aZip
{
[zip autorelease];
zip = [aZip retain];
}
@end
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.