我在使用Android的Parse SDK时遇到了一些麻烦。我无法重现该问题,但是从日志中我知道我打电话时会发生
bookParse.saveEventually { ex -> ... }
例外是:
Attempted to fetch an object offline which was never saved to the offline cache.
主要问题是,在我最终调用saveEvent之前,我先做过bookParse.pin()
。我应该额外做些什么吗?
同样,这不是BookParse对象的插入,而是对对象进行如下查询后所做的更新:
val query = ParseQuery.getQuery(BookParse::class.java)
query.fromNetwork()
query.whereEqualTo("localId", localId)
query.getFirstInBackground { bookParse, ex ->
//do stuff to bookParse
bookParse.pin()
bookParse.saveEventually { ex -> ... }
}