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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:55:09+00:00 2026-05-26T14:55:09+00:00

I have set the following code in a viewWillAppear method. – (void)viewWillAppear:(BOOL)animated { //some

  • 0

I have set the following code in a viewWillAppear method.

- (void)viewWillAppear:(BOOL)animated 
 {  
     //some code of ausregion
     mapView.region = AusRegion;
     mapView.showsUserLocation = NO;
     addressField.text = [NSString stringWithFormat:@""];
     [super viewWillAppear:animated];
 }

It opens well when my application launch first screen. This is my map application and I have set code on button click event to perform some action. [eg. textfield get filled with current address and map get zoom in to current location with annotation]. Now when I jump on another list view controller and get back to my first screen the – (void)viewWillAppear:(BOOL)animated method again get called with blank textfield, no current location etc. I want to retain the screen with previous changes [eg. textfield filled with current address and map zoom in to current location with annotation]. after returning from listview controller to my first screen.

How should I achieve this?

Edited:
I am calling list view controller on following action

     RootViewController *list =
[[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil];
    [self presentModalViewController:list animated:YES];

And after returning from RootViewController I want Map View with current annotation as I performed action before getting list view in RootViewController instead of just Australia continent.

  • 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-26T14:55:09+00:00Added an answer on May 26, 2026 at 2:55 pm

    Try using viewDidLoad instead of viewWillAppear. Then that code will only run when the view is loaded (from the nib), and not every time it will re-appear.

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

Sidebar

Related Questions

I have the following code set up in my Startup IDictionary<string, string> properties =
I have following code in my application: // to set tip - photo in
I have the following code to set a userId variable: (userId set in prior
I have the following code: UPDATE myTable SET Col1 = @Value However, I have
I have the following code: private static final Set<String> allowedParameters; static { Set<String> tmpSet
I have the following code that seems like it should set my insertParameter but
I have to following code fragment, and no matter what I set the font-size
I have written following code to make a call also have set permissions in
I have set the background for a given view using the following code, however,
I have the following code, I have set the bgcolor and still my page

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.