简体   繁体   中英

Pin method in Parse.com doesn't finish

After searching SO and reading

Parse SDK pinInBackground callback does not return

Android Parse.com pinAllInBackground large data very slow on device and crash on genymotion

I am using Parse.com to retrieve data from remote then pin list of objects to the local datastore . I already initialized parse to enable local data store using Parse.enableLocalDatastore(this); Methods I tried: parseObject.pin() parseObject.pin(String string) parseObject.pinInBackground(SaveCallback saveCallback)

ParseObject.pinAll(list<parseObjects> parseObjects) ParseObject.pinAll(String string, list<parseObjects> parseObjects)

Those methods sometomes works perfectly and sometimes if a synchronous pin method the UI thread hangs forever, and when using an asynchronous pin method which works in background, the callback method provided in the parameters sometimes never called. Is there any circumstances leads to that the pin method doesn't work?

  • My problem was that i had a column contains array of pointers. In class _User i added a column called favorite

Say that User1 assigned User2 as favorite, and User2 assigned User1 also as favorite.

According to this

Pinning a ParseObject is recursive, just like saving, so any objects that are pointed to by the one you are pinning will also be pinned.

Which is mentioned in the documentation of parse then calling pin in User1 will go to infinite loop as it seems that it re-pin already pinned objects.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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