Go to previous record in table view
Go to previous record in table view
- Subject: Go to previous record in table view
- From: Michèle Garoche <email@hidden>
- Date: Wed, 19 Dec 2001 05:55:44 +0100
From a newbie:
In Travel Advisor (Learning Cocoa - chapter 10), I've implemented as
mentioned below the method to go to the previous record in table view.
Could someone tell me if it is the right way to do it?
Many thanks in advance.
- (IBAction)prevRecord:(id)sender
{
int aSelectedRow = [countryTableView selectedRow];
aSelectedRow = aSelectedRow - 1;
if (aSelectedRow < 0)
{
aSelectedRow = [countryKeys count] - 1;
}
[countryTableView selectRow:aSelectedRow
byExtendingSelection:NO];
[self handleTVClick: countryTableView];
}