Ios 滑动删除在iPhone5上不起作用,但在模拟器中起作用

Ios 滑动删除在iPhone5上不起作用,但在模拟器中起作用,ios,ios7,swift,iphone-5,swipe-gesture,Ios,Ios7,Swift,Iphone 5,Swipe Gesture,我只是做了一个简单的应用程序。滑动删除功能在模拟器(iPhone5、iOS 7.0)中运行良好,但在iPhone5设备(iOS 7.0)上不起作用。当我刷卡时,它会显示“删除”按钮。但当我点击删除按钮时,什么也没发生。 这是我的密码: func controllerWillChangeContent(controller: NSFetchedResultsController!) { tableView.beginUpdates() } func controller(controlle

我只是做了一个简单的应用程序。滑动删除功能在模拟器(iPhone5、iOS 7.0)中运行良好,但在iPhone5设备(iOS 7.0)上不起作用。当我刷卡时,它会显示“删除”按钮。但当我点击删除按钮时,什么也没发生。 这是我的密码:

func controllerWillChangeContent(controller: NSFetchedResultsController!) {
    tableView.beginUpdates()
}
func controller(controller: NSFetchedResultsController!, didChangeObject anObject: AnyObject!, atIndexPath indexPath: NSIndexPath!, forChangeType type: NSFetchedResultsChangeType, newIndexPath: NSIndexPath!) {
        switch type {
        case .Insert:
            tableView.insertRowsAtIndexPaths([newIndexPath], withRowAnimation: .Fade)
        case .Delete:
            tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade)
        case .Update:
            tableView.reloadRowsAtIndexPaths([indexPath], withRowAnimation: .Fade)
        default:
            tableView.reloadData()
            }
            todos = controller.fetchedObjects as [Todo]
}
func controllerDidChangeContent(controller: NSFetchedResultsController!) {
            tableView.endUpdates()
}

//RowAction: Delete
override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
}
override func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [AnyObject] {
    var deleteAction = UITableViewRowAction(style: UITableViewRowActionStyle.Default, title:"Delete", handler: { (action:UITableViewRowAction!, indexPath:NSIndexPath!) -> Void in
        if let managedObjectContext = (UIApplication.sharedApplication().delegate as AppDelegate).managedObjectContext {
            let todoDelete = self.fetchResultController.objectAtIndexPath(indexPath) as Todo
            managedObjectContext.deleteObject(todoDelete)
            var e: NSError?
            if managedObjectContext.save(&e) != true{
                println("delete error: \(e!.localizedDescription)")
            }
        }
    })
    return [deleteAction]
}