setPossession method


#1

Just a quick question. When you implement this code from pg 220, you pass a message to the detailViewController to set the instance variable possession to the given possession in the row you clicked. But, we never declared or implemented this method in the itemDetailViewController, so where did it come from?

[code]- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
ItemDetailViewController *detailViewController = [[[ItemDetailViewController alloc] init] autorelease];

NSArray *possessions = [[PossessionStore defaultStore] allPossessions];
[detailViewController setPossession:[possessions objectAtIndex:[indexPath row]]];

[[self navigationController] pushViewController:detailViewController animated:YES];

}
[/code]


#2

Hi,

@synthesize possession; generates a setPossession (setter) and a possession (getter) for you.

Gareth