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