- (void)viewDidLoad {
[super viewDidLoad];
UIAlertView * alertV = [[UIAlertView alloc] initWithTitle:@"textfield" message:nil delegate:self cancelButtonTitle:nil otherButtonTitles:@"yes",@"no", nil];
[alertV setAlertViewStyle:UIAlertViewStylePlainTextInput];//将其设置成文本输入的格式
[alertV show];
}
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
UITextField *nameField = [alertView textFieldAtIndex:0];//获取对应的文本输入框
NSLog(@"---%@",nameField.text);
}