If you want to add a TextField to an UIAlertView, you can use this property (alertViewStyle) for UIAlertView:
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Title"
message:@"Message"
delegate:self
cancelButtonTitle:@"Done"
otherButtonTitles:nil];
alert.alertViewStyle = UIAlertViewStylePlainTextInput;
[alert show];
[alert release];
and in .h file of it add UIAlertViewDelegate as a protocol and implement the alertView:clickedButtonAtIndex delegate method in the .m file:
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
NSLog(@"%@", [alertView textFieldAtIndex:0].text);
}
I hope, it works for you!
Note: “Available in iOS 5.0 and later”