通过object.saveEventually(),我将能够将本地存储中的数据与Parse中的云同步.
但这是我感到困惑的,在文档中,它声明:
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
但接下来,下一个示例,几个段落之后,取消所有对象,然后通过将名称为Highscores的新分数数组固定来更新Highscores
PFQuery *query = [PFQuery queryWithClassName:@"Gamescore"]; [query orderByDescending:@"score"]; // Query for new results from the network [[query findObjectsInBackground] continueWithSuccessBlock:^id(BFTask *task) { return [[PFObject unpinAllObjectsInBackgroundWithName:@"Highscores"] continueWithSuccessBlock:^id(BFTask *ignored) { // Cache the new results. NSArray *scores = task.result; return [PFObject pinAllInBackground:scores withName:@"Highscores"]; }]; }];
因此,我是否应该取消固定Highscores的所有对象以更新Highscores中的现有分数?
findObjectsInBackground会自动更新任何被固定的找到的对象吗?我很困惑.
谢谢!