使用currentUser更新用户信息时解析错误

时间:2015-12-20 14:11:40

标签: ios objective-c parse-platform save

我正在尝试为@"matches"更新自定义列([PFUser currentUser])但是我收到此错误:

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

...使用此代码:

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.
                  }
              }];
          }

我认为冗余不会受到影响,我更新了我的Parse SDK,以确保不是问题,就像其他一些人一样。我做错了什么?

0 个答案:

没有答案