独自のナビゲーションバーと1つのテーブルビューを持つビューがあります。そのテーブルビューのアイテムを編集および削除したい。このようにナビゲーションバーにボタンを配置して編集しました。
self.navItem.leftBarButtonItem = self.editButtonItem;
また、このような方法が1つあります。
- (void)tableView:(UITableView *)tv commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if(editingStyle == UITableViewCellEditingStyleDelete) {
//Get the object to delete from the array.
//Delete the object from the table.
[self.tblView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
}
しかし、そのボタンをクリックすると、テーブルビューのどのアイテムもその赤いマークのアイコンで回転しません。編集ボタンのキャプションだけが「完了」に変わります。
何が問題なのですか?