在Parse上向SignUpViewController添加多个字段

use*_*452 2 ios parse-platform

该教程讨论了为字段添加用户名,密码,电子邮件和其他内容,并说您可以更改占位符文本,但没有添加更多字段.

例如,在我的Core _Users数据中,我添加了两列,firstName和lastName.我想为这些添加两个字段.我还需要知道如何确保这些字段适当地传递给数据.有帮助吗?

Hig*_*asy 5

I'd recommend building your own sign in/up view controller's. It'll be much easier that way.

Update:
After checking out the Parse docs, I found this:

signUpController.fields = (PFSignUpFieldsUsernameAndPassword
                               | PFSignUpFieldsSignUpButton
                               | PFSignUpFieldsEmail
                               | PFSignUpFieldsAdditional
                               | PFSignUpFieldsDismissButton);
Run Code Online (Sandbox Code Playgroud)

With the focus on the PFSignUpFieldsAdditional property. It appears as if adding that to the bit mask will add the additional field to the view controller, just as the documentation says.

就从该字段中检索数据而言,它看起来好像PFSignUpViewController具有属性signUpView,该属性具有属性additionalField.

注册成功后,您应该从该字段中提取该值并将其分配给用户,如下例所示:

- (void)signUpViewController:(PFSignUpViewController *)signUpController didSignUpUser:(PFUser *)user {
    NSString *additionalInformation = signUpController.signUpView.additionalField.text;

    user["additionalField"] = additionalInformation;
    [user saveInBackground];
}
Run Code Online (Sandbox Code Playgroud)

如果您需要的字段多于Parse提供的ONE附加字段,则应创建自己的注册控制器.