0
我的工作要求我使用SQLite數據庫的項目,我一直在試圖讓滑動刪除在我的tableView工作:SQLite數據庫和滑動刪除
[self performSelectorOnMainThread:@selector(removeMovieFromCache:) withObject:[NSNumber numberWithInt:movieId] waitUntilDone:YES];
[db performSelectorOnMainThread:@selector(performQuery:) withObject:[NSString stringWithFormat:@"DELETE FROM movie WHERE id = %d", movieId] waitUntilDone:YES];
[db performSelectorOnMainThread:@selector(performQuery:) withObject:[NSString stringWithFormat:@"DELETE FROM new_movies WHERE new_movie_id = %d", movieId] waitUntilDone:YES];
[self removeMovieFromCache:movieId];
[db performQueryWithFormat:@"DELETE FROM movie WHERE id = %d", movieId];
[db performQueryWithFormat:@"DELETE FROM new_movies WHERE new_movie_id = %d", movieId];
[db performQuery:@"COMMIT"];
這就是代碼來擺脫我的數據庫中的東西。當我嘗試將這個應用到我的滑動刪除命令:
-
(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)movieID
{
if (editingStyle == UITableViewCellEditingStyleDelete)
{
//code goes here
}
}
它只是不想工作,我做錯了什麼?
我有但不是在這種風格:「的tableView :commitEditingStyle:forRowAtIndexPath:「我用過」 - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath「等,但我還沒有最後一個,如何我應該執行它們嗎? – 2011-01-09 13:40:29