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 7730585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:15:44+00:00 2026-06-01T06:15:44+00:00

I have a simple app that will allow a user to tag a location.

  • 0

I have a simple app that will allow a user to tag a location. 2 buttons in the app 1 to clear tags and 1 to tag location.

I have working UIAlertview with UITextfield embedded. I need to take the user input from UITextfield and apply it to annotation on the map. My tag button code is below

- (void) tag
{
MapAnnotation *annotation = [[MapAnnotation alloc] initWithCoordinate:current.coordinate];

NSString *locString = [NSString stringWithFormat:@"%f, %f", current.coordinate.latitude, current.coordinate.longitude];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.timeStyle = NSDateFormatterLongStyle;
//insert UITextfield
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Name your Location" message:nil delegate:self cancelButtonTitle:@"Continue" otherButtonTitles: nil];
alert.alertViewStyle = UIAlertViewStylePlainTextInput;
UITextField * alertTextField = [alert textFieldAtIndex:0];
alertTextField.keyboardType = UIKeyboardTypeDefault;
alertTextField.placeholder = @"Enter title of your tag";

[alert  show];
// I have tried numerous variations of NSString below
//NSString *pintitle = NSLog(@"%@", alertTextField.text);
annotation.title = pintitle; 
annotation.subtitle = locString;

[mapView addAnnotation:annotation];
}

i have tried several options some returning a null value and others nothing. I am beginning iOS development and just can’t get this part figured out

  • 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-06-01T06:15:45+00:00Added an answer on June 1, 2026 at 6:15 am

    You need to catch the input of the text field when the alert is dismissed. This code assumes that your keep a reference of the new or edited annotation.

    - (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex {
       UITextField *textField = [alertView textFieldAtIndex:0];
       self.annotationBeingEdited.subtitle = textField.text;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple webforms app that will allow field techs to order
I'm working on a very simple iPhone app, that in the end will have
The usual case. I have a simple app that will allow people to upload
I am working on an app that will allow a user to take quick
I have one simple app that suppose to get information from user and send
We are developing a web app that will have a pretty complex user and
Background: I am trying to create a really simple iPhone app that will allow
I'm building an app that will allow the user to send a status update
I'm developing an app that will allow the user user to view the contents
I have this app of mine that contains a section that will allow the

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.