我可以删除我的表视图中的行。但我想对parse.com上的信息做同样的事情。我该怎么做,有什么建议吗?
override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
if editingStyle == UITableViewCellEditingStyle.Delete {
// Delete the row from the data source
tableView.beginUpdates()
usernames.removeAtIndex(indexPath.row)
tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade)
tableView.endUpdates()
} else if editingStyle == .Insert {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}发布于 2015-12-25 05:26:04
假设usernames是一组PFObject(可能是PFUser),那么您只需要在tableView.beginUpdates()后面添加usernames[indexPath.row].deleteInBackground()
https://stackoverflow.com/questions/34454974
复制相似问题