UITableView not displaying delete/move icons??
@interface SettingsViewController : UIViewController <UITableViewDelegate> {
IBOutlet UITableView *settingsTableView;
I implement the methods that should show the delete/move icon buttons in the table but they won't show up. Can't figure out why??
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
self.title = @"Settings";
self.tabBarItem.image = [UIImage imageNamed:@"Gears.png"];
UINavigationItem *navigationItem = self.navigationItem;
navigationItem.title = @"Name Settings";
self.navigationItem.leftBarButtonItem = self.editButtonItem;
}
return self;
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationLeft];
}
}
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
return YES;
}
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
NSDictionary *currentName =[[[boyNameChoices objectAtIndex:fromIndexPath.row] retain] autorelease];
[boyNameChoices removeObjectAtIndex:fromIndexPath.row];
[boyNameChoices insertObject:currentName atIndex:toIndexPath.row];
}
I can swipe left to right and get the red delete button on the right but not the circle and most importantly not the move icon on the right of the cell.
iMac 24" 2.8g, iPhone 16g Black, 2.1, iPod Touch 16g, Mac OS X (10.5.5)