Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1049537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:37:54+00:00 2026-05-16T16:37:54+00:00

I have a UIAlertView set up with a textfield like so: //***first set of

  • 0

I have a UIAlertView set up with a textfield like so:

//***first set of code***  
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"User Input Required" message:@"Please enter data into the field" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok", nil];  
    [alert addTextFieldWithValue:nil label:@"[Enter Text]"];  
    [[alert textField] becomeFirstResponder];  
    [alert show];  
    [alert release];  
//***second set of code***`

How can I make it so that the user is required to click a button (I have that method already set up to send the input to a string) BEFORE any of the ‘second set of code’ is fired off?

I need that second set of code to be contained in the same section as the alert (so I can’t just run it within the ‘dismissWithClickedButtonIndex’ method) and that second set of code is using the string obtained from the user input, so that is why I don’t want that code to run prior to the user clicking a button.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T16:37:55+00:00Added an answer on May 16, 2026 at 4:37 pm

    You can’t do that. show message in UIAlertView won’t stop for user input. Associated delegates will need to handle the code you are planning to put in //***second set of code*** section.

    Having said that, let me give you some advice. addTextFieldWithValue message is an undocumented API feature. Do not use it. It used to be a long time ago that approval process from Apple for you APP would let you pass even if your application used that addTextFieldWithValue message. But nowadays that does not happen anymore. Your application will be automatically rejected if it is using that undocumented feature. Here is a blog entry on the topic.

    Hope it helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi so say I have this code: UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @Yay
I have an UIAlert UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@ok message:@Canc? delegate:self cancelButtonTitle:@OK otherButtonTitles:@Annul,
I have an application where I am showing an alert message using UIAlertView. By
I have created an alert view with two buttons using the following code: UIAlertView
Here is the code I have to create an UIAlertView with a textbox. UIAlertView
Everybody, I need to set one image on UIAlertView.. I have attached my UIAlertview
I have set up some code so that when two separate buttons are tapped
I have a UIAlertView with a textField on it and two buttons: Save &
I have UIAlertView which holds an UIImage and two default buttons OK and Cancel
I have customized the UIAlertView class. It's working perfectly. I don't want the bounce

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.