I need to add a TextField
to an UIAlertView
. I understand that apple discourage this approach. So is there any library that i could make use of to add
For iOS5:
UIAlertView *av = [[UIAlertView alloc]initWithTitle:@"Title" message:@"Please enter someth" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
av.alertViewStyle = UIAlertViewStylePlainTextInput;
[av textFieldAtIndex:0].delegate = self;
[av show];
Also, you 'll need to implement UITextFieldDelegate
, UIAlertViewDelegate
protocols.