私はこのタイプの質問が以前にSOでここで尋ねられたことを知っています、そして私はそれらのほとんどすべてを試しましたが、役に立ちませんでした。UITableViewから行を削除しようとしています。これが私のコードです。
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete) {
//calls to a method that deletes the row from the backend SQLite database
[self deleteCompany:indexPath.row];
//theCompanies is a NSMutableArray. When the app starts, it retrieves the data and display it in the UITableView
[theCompanies removeObjectAtIndex:indexPath.row];
//Below line is where the error occurs.
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
withRowAnimation:YES
UITableViewRowAnimationFade:UITableViewRowAnimationFade];
}
else if (editingStyle == UITableViewCellEditingStyleInsert) {
}
}
アプリをビルドすると、次のコンパイラエラーが発生します。
'UITableView'の表示された@interfaceはセレクターを宣言しません...
次に何をすべきかわからない。どんな助けでもいただければ幸いです。
ありがとうございました。