我有第二個確認對話框,當用戶決定刪除一個UITableViewCell時出現。這是在正常狀態下我的表視圖:恢復UITableViewCell到正常編輯模式
而且這裏的時候,整個表進入編輯模式,它是:
現在,當用戶點擊左側的紅色減號之一,該單元進入刪除確認模式:
然後,如果用戶敲擊刪除按鈕是剛剛出現,顯示此動作片:
這是哪裏出了問題就出現了。如果用戶確認他們想要刪除地圖,一切都很好。但是,如果取消按鈕被按下,動作片消失,但表視圖仍然是這樣的:
的問題是,刪除確認按鈕應該不再處於選中狀態,並應從視野中隱藏起來。正如你可以看到它沒有。我在文檔中的搜索結果沒有結果。我不想setEditing:NO
,因爲我希望表格保持其正常編輯狀態。有任何想法嗎?
編輯1:這裏是那張裏面tableView:commitEditingStyle:forRowAtIndexPath:
- (void)tableView:(UITableView*)tableView commitEditingStyle:
(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath*)indexPath {
NSInteger finalIndex = [self getFinalIndexForIndexPath:indexPath];
NSString* mapTitle = ((PreviewDataObject*)[[[SingletonDataController sharedSingleton]
getImportedOrSavedMapPreviews:masterIdentifierString]
objectAtIndex:finalIndex]).titleString;
UIActionSheetWithIndexPath* sheet = [[UIActionSheetWithIndexPath alloc] initWithTitle:
[NSString stringWithFormat:@"Are you sure you want to delete the map '%@'?",
mapTitle] delegate:self cancelButtonTitle:@"Cancel"
destructiveButtonTitle:@"Delete Map" otherButtonTitles:nil];
sheet.indexPath = indexPath;
[sheet showFromTabBar:[AppDelegate appDelegate].tabBarController.tabBar];
[sheet release];
}
可以u顯示的代碼 - (空)的tableView:(UITableView的*)的tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath :(NSIndexPath *)indexPath –
你能告訴我們你在這裏的數組名稱是什麼? – vishiphone
在'commitEditingStyle'中,我實際上並沒有做任何刪除;我只是提出了提示用戶是否真的要刪除地圖的操作表。 –