【发布时间】:2016-09-03 02:44:10
【问题描述】:
我很难在 Kinvey 上更新已注册的用户。
例如,如果我使用此代码注册新用户:
KCSUser.userWithUsername(
"kinvey",
password: "12345",
fieldsAndValues: [
KCSUserAttributeEmail : "kinvey@kinvey.com",
KCSUserAttributeGivenname : "Arnold",
KCSUserAttributeSurname : "Kinvey"
],
withCompletionBlock: { (user: KCSUser!, errorOrNil: NSError!, result: KCSUserActionResult) -> Void in
if errorOrNil == nil {
//was successful!
let alert = UIAlertView(
title: NSLocalizedString("Account Creation Successful", comment: "account success note title"),
message: NSLocalizedString("User created. Welcome!", comment: "account success message body"),
delegate: nil,
cancelButtonTitle: NSLocalizedString("OK", comment: "OK")
)
alert.show()
} else {
//there was an error with the update save
let message = errorOrNil.localizedDescription
let alert = UIAlertView(
title: NSLocalizedString("Create account failed", comment: "Create account failed"),
message: message,
delegate: nil,
cancelButtonTitle: NSLocalizedString("OK", comment: "OK")
)
alert.show()
}
}
)
我将如何更新 KCSUserAttributeGivenname 或 KCSUserAttributeSurname。
任何帮助将不胜感激。谢谢
【问题讨论】: