我是解剖和开发的新手。我在swift中创建了一个应用程序,我正在尝试将各种字段从我的注册屏幕传输到Parse.com。我不知道如何在我的应用程序中实际完成具体细节。
我从youtube上的各种视频中拼凑了我的代码。但是我在大多数" newUser中遇到错误。* = *"部分代码。唯一没有错误输出的是用户类中已存在的项目。我添加了列,但仍然没有。
@IBAction func registerTapped(sender: AnyObject) {
var firstname = self.firstNameField.text
var lastname = self.lastNameField.text
var email = self.emailAdressField.text
var businessname = self.businessNameField.text
var foodconcept = self.foodConceptField.text
var password = self.passwordField.text
var businessphonenumber = self.businessPhoneNumberField.text
if (passwordField != confirmPasswordField){
var alert = UIAlertView(title: "Alert", message: "Passwords do not match", delegate: self, cancelButtonTitle: "Ok")
} else {
self.actInd.startAnimating()
var newUser = PFUser()
newUser.firstname = firstname
newUser.lastname = lastname
newUser.email = email
newuser.businessname = businessname
newUser.foodconcept = foodconcept
newUser.password = password
newUser.businessphonenumber = businessphonenumber
newUser.signUpInBackgroundWithBlock({ (succeed, error) -> Void in
self.actInd.stopAnimating()
if ((error) != nil) {
var alert = UIAlertView(title: "Alert", message: "\(error)", delegate: self, cancelButtonTitle: "Ok")
alert.show()
} else {
var alert = UIAlertView(title: "Success", message: "Registered", delegate: self, cancelButtonTitle: "Ok")
alert.show()
}
})
}
}
答案 0 :(得分:0)
您无法输入此类自定义列的详细信息 有关信息,请查看Guide
截至目前,您可以通过更改行来解决此问题:
newuser["your_custom_column_name"] = value;
Parse类是一个预定义的类,它没有任何方法可以包含您创建的所有自定义列,因此他们使用上述方法来执行此操作。
希望这会有所帮助:)