简体   繁体   English

解析,如何将数组条目作为多个PFObject发送,为每个数组对象创建一个新行

[英]Parse, How to send array entries as multiple PFObjects, Create a new row for each array object

I'm using Parse as the backend for my app. 我正在使用Parse作为我的应用程序的后端。 My app will be used in the field where service will nonexistent or spotty at best so I need to store information offline. 我的应用程序将用于服务不存在或充斥的领域,因此我需要离线存储信息。 I currently save data for the user in a plist in the background (Title, location coordinates, notes, additional data). 我目前将用户数据保存在后台的plist中(标题,位置坐标,注释,其他数据)。 Since Parse's current iOS offline saving is fairly poor (From what I've read), I was hoping to get around it by creating an array or dictionary from the plist and upload that to Parse by giving it an array once the user is back in cell range. 由于Parse当前在iOS上的离线保存效果不佳(根据我的阅读),我希望通过从plist创建一个数组或字典来解决该问题,并在用户返回后通过为其提供一个数组将其上传到Parse单元格范围。

As it occurs now, when I upload the array, it simply puts the entire contents of the array in a single cell in the database. 现在,当我上传数组时,它只是将数组的全部内容放在数据库的单个单元格中。 Is there a way to parse the array and create a new row for each entry/object in the array? 有没有办法解析数组并为数组中的每个条目/对象创建新行?

I may have overlooked a better way to do this. 我可能忽略了一种更好的方法。 If someone has a suggestion I would appreciate it! 如果有人有建议,我将不胜感激!

I solved it. 我解决了 I iterated through the array using a for loop and added each index as a separate object. 我使用for循环遍历数组,并将每个索引添加为单独的对象。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM