#import "Greeter.h"

@implementation Greeter

- (void) sayHello {
    NSLog(@"Hello, %@.", greetee);
}

// START:code.objects.accessors
- (NSString *) greetee{
    return greetee;
}

- (void) setGreetee: (NSString *) newGreetee{
    [newGreetee retain];
    [greetee release];
    greetee = newGreetee;
}
// END:code.objects.accessors

- (id)init {
    return [self initWithName:@"world"];
}

- (id)initWithName:(NSString *) name  {
    if (self = [super init]) {
        greetee = name;
        return self;
    }
    else return nil;
}
@end
