スワイプしてテーブルビューの削除ボタンをクリックすると、アラートの確認が必要です。基本的に、データを送信する前に「OK」と「キャンセル」ボタンでアラートポップアップを表示したい:
[[ConnectionSingleton getInstance] sendData:[NSString stringWithFormat:@"modifOrderFoodState::%@::%@::%@", [cellOrder objectForKey:@"orderFoodRelId"], state, [ConnectionSingleton getInstance].restaurantId] ];
クライアントがキャンセル ボタンをクリックすると、データ送信機能が中止されます。
これは私のコードです:
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
NSMutableDictionary *cellOrder = [orders objectAtIndex:indexPath.row];
NSString *state = @"4";
if (editingStyle == UITableViewCellEditingStyleDelete) {
[[ConnectionSingleton getInstance] sendData:[NSString stringWithFormat:@"modifOrderFoodState::%@::%@::%@",
[cellOrder objectForKey:@"orderFoodRelId"],
state,
[ConnectionSingleton getInstance].restaurantId] ];
}
}
ありがとう