- Timestamp:
- 09/16/11 16:55:43 (21 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
apps/iphone/superbook/trunk/Classes/LocateThem_ViewController.m
r899 r902 480 480 481 481 - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { 482 if (indexPath.section == LTSectionVisited) 483 return YES; 484 return NO; 482 return YES; 485 483 } 486 484 487 485 - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { 488 NSInteger maxRows = [domainsLastVisited numberOfCachedLookups]; 489 if ((indexPath.row == lastVisitedRowCount) && (lastVisitedRowCount < maxRows)) { 490 return UITableViewCellEditingStyleNone; // See More row 486 if (indexPath.section == LTSectionVisited) { 487 NSInteger maxRows = [domainsLastVisited numberOfCachedLookups]; 488 if ((indexPath.row == lastVisitedRowCount) && (lastVisitedRowCount < maxRows)) { 489 return UITableViewCellEditingStyleNone; // See More row 490 } 491 491 } 492 492 return UITableViewCellEditingStyleDelete; … … 494 494 495 495 - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { 496 if ([domainsLastVisited deleteCachedDataForRow:[indexPath row]]) { 497 lastVisitedRowCount--; 498 [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; 499 if ([tableView numberOfRowsInSection:indexPath.section] == 0) { 500 [tableView reloadSections:[NSIndexSet indexSetWithIndex:indexPath.section] withRowAnimation:UITableViewRowAnimationNone]; 501 } 496 [tableView beginUpdates]; 497 if (indexPath.section == LTSectionVisited) { 498 if ([domainsLastVisited deleteCachedDataForRow:[indexPath row]]) { 499 lastVisitedRowCount--; 500 } 501 } else if (indexPath.section == LTSectionContacts) { 502 [[FriendsData sharedInstance] removeTelAtIndexPath:indexPath]; 503 } 504 [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; 505 [tableView endUpdates]; 506 if ([tableView numberOfRowsInSection:indexPath.section] == 0) { 507 [tableView reloadSections:[NSIndexSet indexSetWithIndex:indexPath.section] withRowAnimation:UITableViewRowAnimationNone]; 502 508 } 503 509 }








