如何重新排序 TableView 中的行以及保存在 CoreData 中的更改?
我已经搜索了几天的答案,以解决该问题的答案,如何用Swift保存重新订购表?互联网上的许多教程都显示了如何重新排序以及如何与Coredata保存。
这是我的代码。我错了?
请你能帮我解决解决方案吗?非常感谢。
=============================================== ====================================================
func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath)
{
// SecStoredArray = Array name
let itemMove = SecStoredArray[sourceIndexPath.row]
SecStoredArray.remove(at: sourceIndexPath.row)
SecStoredArray.insert(itemMove, at: destinationIndexPath.row)
}
=======================================
我正在使用此代码进行重新排序tableview cell这是工作的,但是我有一个问题单元格无法保存在核心数据中,请任何人帮助我?
I search already a few days to the answer on the question how can I save the reorder TableView with Swift? So many tutorials on the internet show how to reorder and how to save with Coredata.
This is my code right now. What do I wrong?
Please can you help me to the solution? Thank you very much.
======================================================================
func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath)
{
// SecStoredArray = Array name
let itemMove = SecStoredArray[sourceIndexPath.row]
SecStoredArray.remove(at: sourceIndexPath.row)
SecStoredArray.insert(itemMove, at: destinationIndexPath.row)
}
======================================================================
i'm Using this code for reorder TableView Cell It's Work but I have a one problem The Cell value can't Save In core data Please Any one help me ???????
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论