我希望能够只有一个登录屏幕。用户每次登录时都会输入用户名、电子邮件和密码。我在注册、注销然后尝试使用相同的凭据登录时遇到问题,我只是收到一条错误消息,提示用户名已被使用。如果他们给了我正确的凭据,我怎样才能让他们登录?
PFUser *user = [PFUser user];
user.email = emailEntry;
user.username = nickNameEntry;
user.password = passwordEntry;
[user signUpInBackgroundWithBlock:^(BOOL succeeded, NSError *error)
{
if (!error)
{
[MYAlertView showAlertWithTitle:@"Successful login"
message:@"success"
cancelButtonTitle:@"OK"];
}
else
{
NSString *errorString = [[error userInfo] objectForKey:@"error"];
[MyAlertView showAlertWithTitle:@"There was an error signing up."
message:errorString
cancelButtonTitle:@"OK"];
}
}];