gpt4 book ai didi

ios - 使用重置解析功能解析 iOS

转载 作者:行者123 更新时间:2023-12-01 19:00:54 25 4
gpt4 key购买 nike

我想实现一个允许用户重置密码的功能。我已经创建了一个显示警报 View 并询问他们的电子邮件的按钮,但是当我点击确定时,它不会发送电子邮件。

我能做些什么?

-(IBAction)forget:(id)sender {

[PFUser requestPasswordResetForEmailInBackground:@"email@example.com"];

UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Email Address" message:@"Enter the email for your account:" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok", nil];
alertView.alertViewStyle = UIAlertViewStylePlainTextInput;
[alertView show];
}

最佳答案

- (IBAction)forget:(id)sender {
[self getEmail];
}

- (void)getEmail {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Email Address" message:@"Enter the email for your account:" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok", nil];
alertView.alertViewStyle = UIAlertViewStylePlainTextInput;
[alertView show];
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex != [alertView cancelButtonIndex]) {
UITextField *emailTextField = [alertView textFieldAtIndex:0];
[self sendEmail:emailTextField.text];
}
}

- (void)sendEmail:(NSString *)email{
[PFUser requestPasswordResetForEmailInBackground:email];
}

关于ios - 使用重置解析功能解析 iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23045714/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com