【发布时间】:2015-04-21 15:49:54
【问题描述】:
我有一个应用程序,其中一个用户(当前用户)将访问他的数据的权限授予另一个用户。当前用户输入他想要授予访问权限的人的用户名。这是我的代码:
var generalInfo = PFObject(className:"ClientData")
generalInfo.objectId = clientIDPassed //This makes sure that I'm changing the right object.
generalInfo.ACL = PFACL.ACLWithUser(newUserEmail.text) //newUserEmail.text is the text field. Error on this line.
generalInfo.saveInBackground()
这是错误:
无法使用“(字符串)”类型的参数列表调用“ACLWithUser”
我在想我的问题是 newUserEmail.text 是一个字符串,但 Parse 正在寻找一个 PFUser。知道如何解决吗?
【问题讨论】:
-
通过传递
PFUser对象而不是String。 -
@nhgrif 如何将 newUserEmail.text 转换为 PFUser?这不起作用: userPF = newUserEmail.text as? PFUser 没有工作。谢谢!
-
我不知道。看一些文档。我假设您不能只将字符串转换为用户......这不一定有多大意义。
-
对不起,我的回答是假的。我改了。用户无法访问安装表。
标签: swift parse-platform acl