我想将 UITableView 的数据备份到 Parse。首先用户登录。现在每个用户都应该拥有自己的 UITableView 云存储保存,但是如何在按下按钮(保存)时上传此 UITableView 或 UITableViewCell?
最佳答案
您可以创建单独的模型对象来填充 UITableView 的每个单元格。 documentation 中对将对象保存到解析中进行了很好的解释。 :
如果您还需要更多解释,另请参阅本教程: Tutorial
Parse 只是一个后端
,它允许您通过调用它们的函数来保存数据。
解析的概念是通过使用他们的 api 和数据库来显示您应用程序中的数据。
在解析数据库中保存 PFObject(解析对象)的示例:
let testObject = PFObject(className: "TestObject") // Create the PFObject with the classname/tablename on parse
testObject["foo"] = "bar" // set the property "foo" to "bar"
// save the object in background (not on the gui thread to prevent lags on the UI)
testObject.saveInBackgroundWithBlock { (success: Bool, error: NSError?) -> Void in
println("Object has been saved.")
}
注意:在能够调用这些函数并在那里创建对象之前,您需要导入解析库并初始化您的应用以进行解析。
关于uitableview - 如何在 Parse 中将数据保存到用户?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29741408/