|
|
1.1 ! root 1: /*-------------------------------------------------------------------------- ! 2: * ! 3: * You may freely copy, distribute, and reuse the code in this example. ! 4: * SHL Systemhouse disclaims any warranty of any kind, expressed or ! 5: * implied, as to its fitness for any particular use. ! 6: * ! 7: * Publisher ! 8: * ! 9: * Inherits From: NSObject ! 10: * ! 11: * Conforms To: None ! 12: * ! 13: * Declared In: Address.h ! 14: * ! 15: *------------------------------------------------------------------------*/ ! 16: #import "Address.h" ! 17: #import <foundation/NSString.h> ! 18: ! 19: ! 20: ! 21: ! 22: @implementation Address ! 23: ! 24: /*-------------------------------------------------------------------------- ! 25: * Init and Dealloc ! 26: *------------------------------------------------------------------------*/ ! 27: - init ! 28: { ! 29: [super init]; ! 30: return self; ! 31: } ! 32: ! 33: ! 34: - (void) dealloc ! 35: { ! 36: [address autorelease]; ! 37: [city autorelease]; ! 38: [state autorelease]; ! 39: [zip autorelease]; ! 40: [super dealloc]; ! 41: } ! 42: ! 43: ! 44: /*-------------------------------------------------------------------------- ! 45: * Accessors ! 46: *------------------------------------------------------------------------*/ ! 47: - (NSString *) address ! 48: { ! 49: return address; ! 50: } ! 51: ! 52: ! 53: - (NSString *) city ! 54: { ! 55: return city; ! 56: } ! 57: ! 58: ! 59: - (NSString *) state ! 60: { ! 61: return state; ! 62: } ! 63: ! 64: ! 65: - (NSString *) zip ! 66: { ! 67: return zip; ! 68: } ! 69: ! 70: ! 71: - (void) setAddress: (NSString *)anAddress ! 72: { ! 73: [address autorelease]; ! 74: address = [anAddress retain]; ! 75: } ! 76: ! 77: ! 78: - (void) setCity: (NSString *)aCity; ! 79: { ! 80: [city autorelease]; ! 81: city = [aCity retain]; ! 82: } ! 83: ! 84: ! 85: - (void) setState: (NSString *)aState ! 86: { ! 87: [state autorelease]; ! 88: state = [aState retain]; ! 89: } ! 90: ! 91: ! 92: - (void) setZip: (NSString *)aZip ! 93: { ! 94: [zip autorelease]; ! 95: zip = [aZip retain]; ! 96: } ! 97: ! 98: ! 99: @end ! 100:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.