获得UIAlertView的输入值

来源:互联网 发布:58同城网招聘淘宝客服 编辑:程序博客网 时间:2024/05/26 02:20
- (void)viewDidLoad {    [super viewDidLoad];    // Do any additional setup after loading the view, typically from a nib.        UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"请输入证书密码" delegate:nil cancelButtonTitle:nil otherButtonTitles:@"确定",nil];    alertView.alertViewStyle = UIAlertViewStyleLoginAndPasswordInput;        UITextField* textfield = [alertView textFieldAtIndex:0];    textfield.secureTextEntry = YES;    textfield.keyboardType = UIKeyboardTypeNumberPad;    textfield.delegate = self;    textfield.placeholder = @"请输入密码";    alertView.delegate = self;    [alertView show];}- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{  UITextField *input = [alertView textFieldAtIndex:1];    NSLog(@"%@",input.text);}

0 0
原创粉丝点击