Parse Unpin Does Not Remove Object From Local Datastore

前端 未结 4 1357
既然无缘
既然无缘 2020-12-15 18:27

This should work.

Here is one of many attempts to get this figured out

            myTrainingSessions[indexPath.row].unpinInBackgroundWithBlock{ (suc         


        
4条回答
  •  无人及你
    2020-12-15 19:04

    After doing R & D on parse.com I come to know that you can unpin objects from local storage once they are stored on cloud. B'coz parse is basically used for storing data on cloud so it allow unpinning of data after storing on cloud. eg.

    - (void)syncDataToCloud:(id)sender {
        PFQuery *qry = [PFQuery queryWithClassName:@"Person"];
        [qry fromLocalDatastore];
        NSArray *arr = [qry findObjects];
        [PFObject saveAllInBackground:arr block:^(BOOL succeeded, NSError *error) {
            if (succeeded) {
                DisplayAlert(@"Sync successful.");
            } else {
                DisplayAlert(@"Sync unsuccessful");
            }
        }];
        [PFObject unpinAll:arr];
    }
    

    it works for me...!! :)

提交回复
热议问题