Alert View with textfield in xcode?


UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Hello!" 
message:@"Please enter your name:" delegate:self 
cancelButtonTitle:@"Continue" otherButtonTitles:nil];
alert.alertViewStyle = UIAlertViewStylePlainTextInput;
UITextField * alertTextField = [alert textFieldAtIndex:0];
alertTextField.keyboardType = UIKeyboardTypeDefault;
alertTextField.placeholder = @"Enter your name";
[alert show];
Advertisements

3 thoughts on “Alert View with textfield in xcode?

  1. Nice post. I was checking continuously this blog and
    I am inspired! Very useful information particularly the
    closing phase 🙂 I care for such info a lot.
    I used to be looking for this particular info for
    a very long time. Thanks and best of luck.

  2. Thanks for your appreciation.

  3. Thank you. This is very helpful

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s