我正在尝试创建一个应用程序,其中每个PFObject
都有类别Verifications
和Verified_By
.
Verifications
由一个数字组成,并且Verified_By
是一个字符串数组
当我尝试更新类别并保存时PFObject
,数据是正确的并保存在本地,但是当我调用时saveInBackground
,它不会在数据浏览器中更新。
这是我的更新代码:
if (![verifiedBy containsObject:[ViewController getUserName]]) {
//havent verified
NSMutableArray *newArray = [NSMutableArray arrayWithArray:verifiedBy];
[newArray addObject:[ViewController getUserName]];
[toModify setObject:newArray forKey:@"Verified_By"];
[toModify incrementKey:@"Verifications"];
[toModify saveInBackground];
[[[UIAlertView alloc] initWithTitle:@"Verified!" message:@"You have successfully verified this" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil] show];
}
else {
[[[UIAlertView alloc] initWithTitle:@"Already Verified" message:@"You have already verified this" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil] show];