我在 Swift 中删除 Parse 对象时遇到问题。我不断收到常见错误
[Error]: Object not found. (Code: 101, Version: 1.12.0)
我做了很多研究,这通常与 ACL 问题有关。但是,对于尝试删除对象的经过身份验证的用户来说,ACL 看起来是正确的。
_acl": {
"*": {
"r": true
},
"H0NwsFHjgL": {
"r": true,
"w": true
}
}
我已确认该对象是我指定的对象,并且用户是我假设的对象并且已通过身份验证。这几天我一直在头疼这个问题!任何帮助,将不胜感激!!!谢谢!
let query = PFQuery(className: "Place")
query.getObjectInBackgroundWithId(thisPlace.placeID!, block: {(object,error) -> Void in
if(error == nil)
{
print(object)
print(object?.ACL)
print(object?.objectId)
print(PFUser.currentUser()?.objectId)
print(PFUser.currentUser()?.authenticated)
//Error here
object?.deleteInBackground()
}
else
{
print("Post delete failed")
print(error)
}
})
仅供引用,我使用 PFFacebookUtils.logInInBackgroundWithReadPermissions 进行身份验证。不知道这是否重要...
最佳答案
啊...可能不是最佳实践,但我在调用 PFFacebookUtils.logInInBackgroundWithReadPermissions 后使用访问 token 登录,这似乎有效!
PFFacebookUtils.logInInBackgroundWithAccessToken(FBSDKAccessToken.currentAccessToken())
关于ios - 无法在 swift 中删除 Parse 对象 - ACL 问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38934577/