问题描述
我正在尝试保存具有PFFile
作为属性的PFObject
.我正在为iOS使用新的 Local Datastore ,所以我想使用saveEventually()
方法保存此PFObject
.
I am trying to save a PFObject
that has a PFFile
as an attribute. I am using the new Local Datastore for iOS, so I would like to save this PFObject
with the saveEventually()
method.
我遇到的问题是saveEventually()
方法似乎不喜欢保存PFFiles
.我尝试在没有附加任何PFFile
的情况下saveEventually()
我的对象,并且工作正常.重新连接我的PFFile
后,Xcode抛出了几个断点通知(错误?),但没有终止该应用程序,而且看起来一切正常,但是对Parse Data Browser的检查确认保存确实完成了不经过.
在使用本地数据存储"功能之前,我不认为可以进行此保存-它会引发"Unable to saveEventually a PFObject with a relation to a new, unsaved PFFile."
错误. iOS本地数据存储区文档中指出: >
The problem I am encountering is that the saveEventually()
method doesn't seem to like saving the PFFiles
. I tried to saveEventually()
my object without any PFFile
attached, and that worked fine. As soon as my PFFile
was reattached, Xcode threw a couple of breakpoint notices (errors?) but did not terminate the app, and it appears as though all went well - however a check on the Parse Data Browser confirms that the save did not go through.
Prior to the Local Datastore feature I don't believe this save would have been possible - it would have thrown the "Unable to saveEventually a PFObject with a relation to a new, unsaved PFFile."
error. It seems as though the Local Datastore feature has fixed this, as it states in the iOS Local Datastore docs:
我已将SDK更新到最新版本(v1.6.2).有任何想法吗?
I have updated the SDK to the latest version (v1.6.2). Any ideas?
推荐答案
PFFile仍然不支持saveEventually
PFFiles still don't support saveEventually
see here
该页面的最新更新时间:2015年1月23日
That page was last updated : 2015-01-23
您可以pinInBackgroundWithBlock
,如果成功,则将PFFile保存到应用程序捆绑包中的临时文件夹中,并在必要时将其删除或取消固定
You could pinInBackgroundWithBlock
and if successful save the PFFile to a temporary folder in you app bundle and delete it when necessary or unpinned
这篇关于最终使用PFFile(解析本地数据存储)保存在PFObject上吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!