首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何在解析时滑动删除要更新的表单元格?

如何在解析时滑动删除要更新的表单元格?
EN

Stack Overflow用户
提问于 2015-12-24 23:37:35
回答 1查看 63关注 0票数 0

我可以删除我的表视图中的行。但我想对parse.com上的信息做同样的事情。我该怎么做,有什么建议吗?

代码语言:javascript
运行
复制
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
    }    
}
EN

Stack Overflow用户

发布于 2015-12-25 05:26:04

假设usernames是一组PFObject(可能是PFUser),那么您只需要在tableView.beginUpdates()后面添加usernames[indexPath.row].deleteInBackground()

票数 0
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34454974

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档