|
|
Sample Programs from NeXSTEP 3.3
/* Person.m
*
* You may freely copy, distribute, and reuse the code in this example.
* NeXT disclaims any warranty of any kind, expressed or implied, as to its
* fitness for any particular use.
*
*
* A simple class describing a person object.
*
*
*------------------------------------------------------------------------*/
#import <appkit/Application.h>
#import "Person.h"
@implementation Person
/*--------------------------------------------------------------------------
* Initialization and Deallocation
*------------------------------------------------------------------------*/
- init
{
[super init];
return self;
}
- (void) dealloc
{
[firstname autorelease];
[lastname autorelease];
[city autorelease];
[super dealloc];
}
/*--------------------------------------------------------------------------
* Accessors
*------------------------------------------------------------------------*/
- lastname
{
return lastname;
}
- firstname
{
return firstname;
}
- city
{
return city;
}
- (void) setFirstname: (NSString *) aString
{
[firstname autorelease];
firstname = [aString retain];
}
- (void) setLastname: (NSString *) aString
{
[lastname autorelease];
lastname = [aString retain];
}
- (void) setCity: (NSString *) aString
{
[city autorelease];
city = [aString retain];
}
@end
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.