I can not update a record in Parse; Error: "object not found for update (Code: 101, Version: 1.2.16)"

user984694 picture user984694 · Mar 5, 2014 · Viewed 12.2k times · Source

I am using Parse as my backend for one of my native iOS app. I am not able to update a record on a table in Parse. First I query the object that I want to update it. So, "objects" array returns 1 record but when I want to update it I get the following error;

"object not found for update (Code: 101, Version: 1.2.16)"

So what do you think I can not update a record in Parse? (Below is my code)

Thanks, E.

PFQuery *query = [PFQuery queryWithClassName:@"askedFriends"];
[query whereKey:@"questionID" equalTo:aqDt.questionID];
[query whereKey:@"fbID" equalTo:FbId];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {

NSArray *postArray = objects;
PFObject *post = postArray.lastObject;
[post setObject:@"sentReply" forKey:btnSelection];
[post saveInBackground];
}

Answer

Luca Iaco picture Luca Iaco · Mar 5, 2014

I had the same problem, And it was the ACL column for that specific Class table. Ensure to have something like this in your ACL column

{"*":{"read":true},"tyb5CcKwBU":{"write":true,"read":true}}

The "*" allow the read to everyone. You can set client side using something like

ParseACL acl = new ParseACL(<YourObject>);
acl.setPublicReadAccess(true);