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

  • Home
  • SEARCH
  • 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 6714911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:33:03+00:00 2026-05-26T08:33:03+00:00

I have an app with 3 views. I am using a tab bar controller

  • 0

I have an app with 3 views. I am using a tab bar controller to select the views.

I currently have the map set to zoom to the closest location that includes all the annotations. However, when I update the core data in view one, and then select tab 2 but the annotation pin remains the same. Even if I quit the app the pin color reamins the same (it changes color based on data state). the only way I can get it to update, is to zoom far in, then back out.

code I have tried:

[mapView release];

and

[mapView setNeedsDisplay];

and

[mapView removeAnnotation:tempAnnotation];

[mapView addAnnotation:tempAnnotation];

and

CLLocationCoordinate2D center = [mapView centerCoordinate];

[mapView setCenterCoordinate:center];

I even set the map set flyTo the coordinates 2 times, once zoomed far in, then again at ‘normal’ zoom level.

Is there a way to refresh the view on didFinishLoading, etc?

Could I be placing one of these code snippets int he wrong place?

I am also releasing the passed data etc

is it just that the tab bar caches the page? is there a way to force a map refresh?

Thanks! (I am kind of a noob so if you can help, please be clear as to the steps to help me understand)

Robert

  • 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-26T08:33:04+00:00Added an answer on May 26, 2026 at 8:33 am

    I am about to answer my own question with this as well:

    I saw posts on how to reset the view, redraw the layer etc. I am fairly (not new) inexperienced with the language, so what I have done is a hack, but it works. I hope you use this if you have to, but find a better solution.

    View Controller:

    - (void)viewWillAppear:(BOOL)animated {
    
        [super viewWillAppear:animated];
    
        mapView.region = MKCoordinateRegionMakeWithDistance([mapView centerCoordinate],2587600.0, 2587600.0);
    
    }
    
    - (void)viewWillDisappear:(BOOL)animated {
    
        [super viewWillDisappear:animated];
    
        mapView.region = MKCoordinateRegionMakeWithDistance([mapView centerCoordinate],5.0, 5.0);
    }
    

    So when the view leaves, well… view, then the map zooms really far in. When the view returns to view, the the data is reloaded and voila. Your mileage may vary, but this method works perfectly for what I need it to do.

    And it is not a jarring effect at all. It is seamless. From a UI standpoint, nothing changes.

    cheers!
    Robert

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

Sidebar

Related Questions

I have three views that I switch between using a tab bar, and the
In my app I have a tab bar. And in some views I as
I have a multiview application using a tab bar to switch views. One is
I'm currently programming an app for iphone that uses the tab bar. One of
I have an app using a tab bar and, when the app loads, I
I am building a Tab Bar App and have a MapView set up on
I'm developing a WPF app using MVVM. Most of my views have only xaml
I have an app that has a centre view with two views off to
In the iPod app, the navigation views have the default status bar style, and
I have an iPhone app that hides the status bar. However, my main view

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.