UITableView
スワイプして削除する機能をアプリのプレーンに追加するのに何時間も苦労してきましたが、成功しませんでした。
基本セルとカスタム セルを使用するUIViewController
独自のを持っています。UITableView
これは、 のである のUIViewController
上にあります。UINavigationController
centerViewController
IIViewDeckController
のデリゲートとデータソースがUITableView
適切に設定されており、これが現在のコードです。
-(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"canEditRowAtIndexPath");
return YES;
}
-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"commitEditingStyle");
}
-(UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"editingStyleForRowAtIndexPath");
return UITableViewCellEditingStyleDelete;
}
- (void)tableView:(UITableView *)tv didEndEditingRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"didEndEditingRowAtIndexPath");
}
やなどcellForRowAtIndexPath
の他のデリゲート メソッドは適切に呼び出されますが、どのセルでも呼び出されることはありません。canEditRowAtIndexPath
didSelectRowAtIndexPath
editingStyleForRowAtIndexPath
アップデート
私が行う[table setEditing:YES animated:YES];
と、実際に編集モードが有効になります。
ここで何が欠けている可能性がありますか?