Slide 57
Slide 57 text
Class Implementation
#import "Photo.h"
@implementation Photo
@synthesize caption;
@synthesize photographer;
- (id) init
{
if ( self = [super init] )
{
self.caption = @"Default Caption";
self.photographer = @"Default Photographer";
}
return self;
}
- (void) dealloc
{
[self.caption release];
[self.photographer release];
[super dealloc];
}
- (NSString*)description
{
return [NSString stringWithFormat:@"Photo caption: %@, photographer: %@", self.caption,
self.photographer];
}
@end