deleteSections
セクションごとに呼び出すことができました:
static int nos = 4;
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return nos;
}
-(IBAction)onFadeTableButton:(id)sender
{
NSMutableIndexSet *sectionsToDelete = [NSMutableIndexSet indexSet];
[sectionsToDelete addIndex:3];
nos = 3;
[self.tableView deleteSections:sectionsToDelete
withRowAnimation:UITableViewRowAnimationTop];
[sectionsToDelete addIndex:2];
[sectionsToDelete removeIndex:3];
nos = 2;
[self.tableView deleteSections:sectionsToDelete
withRowAnimation:UITableViewRowAnimationMiddle];
[sectionsToDelete addIndex:1];
[sectionsToDelete removeIndex:2];
nos = 1;
[self.tableView deleteSections:sectionsToDelete
withRowAnimation:UITableViewRowAnimationMiddle];
[sectionsToDelete addIndex:0];
[sectionsToDelete removeIndex:1];
nos = 0;
[self.tableView deleteSections:sectionsToDelete
withRowAnimation:UITableViewRowAnimationMiddle];
}
コードは醜いので、既存のプロジェクト (4 つのセクションを含むテーブル ビュー) をすぐに使用していましたが、アイデアは明確でなければなりません。そのまま使わず、キレイにしてください。