tableView 内のセルの移動/再配置を処理する方法を示すコード サンプルを見つけようとしています。
Core データの削除には、以下に記述されているコードを使用します
- (void)tableView:(UITableView *)aTableView commitEditingStyle: (UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete)
{
NSFetchRequest* fetchRequest = [[NSFetchRequest alloc] init];
NSEntityDescription* entityDescription = [NSEntityDescription entityForName:@"MyBase"
inManagedObjectContext:self.objectContext];
[fetchRequest setEntity:entityDescription];
NSArray *empArray=[self.objectContext executeFetchRequest:fetchRequest error:nil];
if ([empArray count] > 0){
Moneybox *employee = [empArray objectAtIndex:indexPath.row];
[self.objectContext deleteObject:employee];
[self.objectContext save:nil];
}
[self buscarContactoExistente];
[myTable reloadData];
}
}
どうやって作るの?
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
同じスタイルで?