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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:02:23+00:00 2026-05-30T17:02:23+00:00

I have a MKMapView displaying some custom locations . Everything works fine until I

  • 0

I have a MKMapView displaying some custom locations . Everything works fine until I press the go back button .

SearchViewController is my class name.

Sometimes I get :

[SearchViewController respondsToSelector:]: message sent to deallocated instance 0x73495f0

Other times :

[SearchViewController mapView:regionDidChangeAnimated:]: message sent
to deallocated instance 0x7343f20

Or :

[SearchViewController mapView:didUpdateUserLocation:]: message sent to deallocated instance 0x7343f20

   These functions are : 


-(void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation 
{

    MKCoordinateRegion mapRegion;   
    mapRegion.center = mapViewHandler.userLocation.coordinate;
    mapRegion.span.latitudeDelta = 0.2;
    mapRegion.span.longitudeDelta = 0.2;

    [mapViewHandler setRegion:mapRegion animated: YES];

}
- (void)mapView:(MKMapView *)mapView didDeselectAnnotationView:(MKAnnotationView *)view
{

    //do nothing
}

This usually happens when I get into the view and then right back out.

Could you help me get rid of this bug ? I have the mapViewHandler created in the .xib file , and used [self.mapViewHandler setDelegate:self]; in viewDidLoad() method.
Is there a way to stop everything from loading(requests,etc.) when I press the go back button and leave this view ?

  • 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-30T17:02:24+00:00Added an answer on May 30, 2026 at 5:02 pm

    When you “go back”, your SearchViewController is being pulled off of the navigation stack and is getting deallocated. However, the MKMapView is still active and is trying to invoke delegate methods on your view controller which no longer exists. Try setting the mapView delegate to nil in your view controller dealloc or viewDidUnload method.

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

Sidebar

Related Questions

I have a MKMapView with some custom annotations that don't look that great when
I have set up an MKMapView with MKAnnotationView s for a bunch of locations.
I have a GPSTestViewController class that has a MKMapView with added MKAnnotations (stored in
I have two views. The first is a MKMapView with some annotations. Clicking a
I have a MKMapView (obviously), that shows housing locations around the user. I have
I have an MKMapView in my app and have a button that turns on
I'm displaying a MKMapView with MKAnnotations some of which are selected and showing their
I am displaying a custom marker on my Google Map. They are placed fine,
I have a MKMapView with it's delegate set to my controller (m) class. Code
I have a MKMapview loading with maybe 5 annotations (right now). It loads fine,

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.