Image within PFFile will be uploaded to parse instead of being saved into the local datastorage

こ雲淡風輕ζ 提交于 2019-11-29 02:45:27
Priyatham51

Okay, take a look here Save eventually on PFObject with PFFile (Parse Local Datastore)?. One this is for sure, if you call save on PFFile it will get save to online datastore. So you should use PFFile.save(). I think best option for you is to save the file in some folder. locally and save that path in PFObject. Parse documentation just say this

"Pinning a PFObject is recursive, just like saving, so any objects that are pointed to by the one you are pinning will also be pinned. When an object is pinned, every time you update it by fetching or saving new data, the copy in the local datastore will be updated automatically. You don't need to worry about it at all."

It recursively calls .pin() on the other objects in your main PFObject. But if you take a look at PFFile API doc it doest have a .pin() which means it doesn't support saving PFFile to local datastore. So I would say you should save them in some directory and save path in your PFObject.

Update

save:

Saves the file synchronously and sets an error if it occurs.

- (BOOL)save:(NSError **)error
Parameters
error
Pointer to an NSError that will be set if necessary.

Return Value
Returns whether the save succeeded.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!