0
我試圖展現一個UIButton當UITableView的是在這樣的編輯模式:顯示一個UIButton時的UITableView處於編輯模式
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
NSLog(@"deleting :%i", indexPath.row);
// Delete the managed object for the given index path
NSManagedObjectContext *context = [fetchedResultsController managedObjectContext];
[context deleteObject:[fetchedResultsController objectAtIndexPath:indexPath]];
self.buttonAdd.hidden = FALSE;
// Save the context.
NSError *error = nil;
if (![context save:&error]) {
NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
exit(-1);
}
}
[self.table reloadData];
}
但是,這並不工作,你有什麼想法?
嘗試使用是或否? – Omarj
我已經試過這些。 – tchike
[tableView setEditing:YES animated:YES]; – Omarj