- (NSIndexPath *)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [[tableView cellForRowAtIndexPath: oldIndexPath] setAccessoryType:UITableViewCellAccessoryNone]; [[tableView cellForRowAtIndexPath: indexPath] setAccessoryType:UITableViewCellAccessoryCheckmark]; SeismicXMLAppDelegate *appDelegate = (SeismicXMLAppDelegate *)[[UIApplication sharedApplication] delegate]; [appDelegate showEarthquakeInfo:[(TableViewCell *)[tableView cellForRowAtIndexPath:indexPath] quake]]; oldIndexPath = indexPath; return nil; } - (NSIndexPath *)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { SeismicXMLAppDelegate *appDelegate = (SeismicXMLAppDelegate *)[[UIApplication sharedApplication] delegate]; [appDelegate showEarthquakeInfo:[(TableViewCell *)[tableView cellForRowAtIndexPath:indexPath] quake]]; [[tableView cellForRowAtIndexPath: oldIndexPath] setAccessoryType:UITableViewCellAccessoryNone]; [[tableView cellForRowAtIndexPath: indexPath] setAccessoryType:UITableViewCellAccessoryCheckmark]; oldIndexPath = indexPath; return nil; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *MyIdentifier = @"MyIdentifier"; TableViewCell *cell = (TableViewCell *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier]; if(indexPath == oldIndexPath){ cell.accessoryType = UITableViewCellAccessoryCheckmark; }else{ cell.accessoryType = UITableViewCellAccessoryNone; } if (cell == nil) { cell = [[[TableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:MyIdentifier] autorelease]; } // Set up the cell. SeismicXMLAppDelegate *appDelegate = (SeismicXMLAppDelegate *)[[UIApplication sharedApplication] delegate]; // If the RSS feed isn't accessible (which could happen if the network isn't available), show an informative // message in the first row of the table. if ([appDelegate isDataSourceAvailable] == NO) { cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"DefaultTableViewCell"] autorelease]; cell.text = NSLocalizedString(@"RSS Host Not Available", @"RSS Host Not Available message"); cell.textColor = [UIColor colorWithWhite:0.5 alpha:0.5]; cell.accessoryType = UITableViewCellAccessoryNone; return cell; } Earthquake *quakeForRow = [appDelegate objectInListAtIndex:indexPath.row]; [cell setQuake:quakeForRow]; return cell; }