//
//  PhoneBookEntry.m
//  TableViewTest
//
//  Created by Lieven Dekeyser on 03/12/09.
//  Copyright 2009 Lieven Dekeyser. All rights reserved.
//

#import "PhoneBookEntry.h"


@implementation PhoneBookEntry

@synthesize name = mName;
@synthesize phone = mPhone;

- (void)dealloc
{
	// Since the name and phone properties retain their values,
	// we need to release them. If the properties haven't been set, they're nil,
	// and since [nil release]; doesn't do anything, we can just go ahead and do this:
	[mName release];
	[mPhone release];
	[super dealloc];
}

+ (PhoneBookEntry *)entryWithName:(NSString *)inName phone:(NSString *)inPhone
{
	// Factory methods (static methods that create an object) should return autoreleased objects
	PhoneBookEntry * result = [[[PhoneBookEntry alloc] init] autorelease];
	result.name = inName;
	result.phone = inPhone;
	return result;
}

@end
