This is simple programming where you can see how to put a UITextField in a UIAlertView. This is simple and just a couple lines of code.
Step 1: Create a new project, using View-base application.
Step 2: We have to added some code in viewcontroller . In viewDidLoad we calling a UIAlertView and then we are adding the UITextField .
[super viewDidLoad];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Enter Your Name "
message:@"Hello"
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"OK!", nil];
UITextField *TextField = [[UITextField alloc] initWithFrame:CGRectMake(12, 45, 260, 25)];
CGAffineTransform Transform = CGAffineTransformMakeTranslation(0, 60);
[alert setTransform:Transform];
[TextField setBackgroundColor:[UIColor whiteColor]];
[alert addSubview:TextField];
[alert show];
[alert release];
}
Step 3: Now you add CoreGraphics.framework in your framework folder.Only shows up in the iPhone SDK frameworks folder, at /Developer/platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/System/Library/Frameworks.
Step 4: Now compile and run your application on the Simulator.
Figure 1: Shows input name using UITextField











