-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
NSString *enteredName = [[alertView textFieldAtIndex:0]text];
NSLog(@"name===>%@",enteredName);
}
如何在 viewDidLoad 或任何其他函数中访问“enteredName”值。我用过 alert.alertViewStyle = UIAlertViewStylePlainTextInput;