0

I am trying to update a custom column (@"matches") for [PFUser currentUser] however I am receiving this error:

PFKeychainStore failed to set object for key 'currentUser', with error: -34018

...using this code:

NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];

PFUser *currentUser = [PFUser currentUser];
    if (currentUser) {
        NSLog(@"there is a current user");

       [currentUser setObject:matchesNumber.text forKey:@"matches"];

       [currentUser saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
           if (!error) {
               // The currentUser saved successfully.
           } else {
               // There was an error saving the currentUser.
           }
       }];
       } else {
           [PFUser logInWithUsernameInBackground:[userDefaults objectForKey:@"pfuser"] password:[userDefaults objectForKey:@"pfpass"]
               block:^(PFUser *user, NSError *error) {
                   if (user) {
                       NSLog(@"user logged in");

                      [user setObject:matchesNumber.text forKey:@"matches"];

                      [user saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
                      if (!error) {
                          // The currentUser saved successfully.
                      } else {
                          // There was an error saving the currentUser.
                      }
                  }];
                  } else {
                      NSLog(@"login failed");
                      // The login failed. Check error to see why.
                  }
              }];
          }

I figure the redundancy can't hurt, and I updated my Parse SDK to make sure that wasn't the problem, as for a few other people, it was. What am I doing wrong?

3
  • What kind of object is matchesNumber? Why are you using matchesNumber.text ? Commented Dec 21, 2015 at 0:02
  • @LonelyPenguin matchesNumber is a UILabel. Commented Dec 21, 2015 at 21:50
  • @LonelyPenguin maybe it is not correct to use setObject with a string...but I also tried with setValue and I got the same error. Commented Dec 21, 2015 at 21:51

1 Answer 1

1

This might be a bug in Parse. See if you can find similarities in this issue: https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/issues/437

Sign up to request clarification or add additional context in comments.

1 Comment

I noticed that, while the error happens, it does not affect the storing of data on parse, so I am just going to ignore the problem for now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.