setter方法
- (void)setRoom:(Room *)room
{
// 传进来的room和_room不一样的时候
if (_room != room) {
// 对旧房间(当前正在用的房间)做一次release操作
[_room release];
// 对新房间做一次retian操作
_room = [room retain];
}
}
- (Room *)room
{
return _room;
}
- (void)dealloc
{
[_room release];
NSLog(@"Person -- dealloc");
[super dealloc];
}