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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:55:32+00:00 2026-05-13T19:55:32+00:00

I have a MKMapView . Sometimes after my view controller is dismissed, I’ll get

  • 0

I have a MKMapView. Sometimes after my view controller is dismissed, I’ll get a EXC_BAD_ACCESS.

I turned on NSSZombies and it looks like the MKMapView‘s delegate — my view controller! — is being called, despite both the MKMapView and UIViewController subclass being freed. I’ve checked, and my memory management is correct.

What’s going on?

  • 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-13T19:55:33+00:00Added an answer on May 13, 2026 at 7:55 pm

    This is because of the way MKMapView works. There’s an operation pending, so MapKit is retaining the MKMapView and it hasn’t actually been deallocated yet. That isn’t itself a problem. The problem is that it’s still sending messages to your delegate.

    The workaround is simple: As part of your view controller’s cleanup set the map view’s delegate to nil, which will prevent MKMapView from sending messages to it.

    This is documented in MKMapViewDelegate Protocol Reference:

    Before releasing an MKMapView object for which you have set a delegate, remember to set that object’s delegate property to nil. One place you can do this is in the dealloc method where you dispose of the map view.

    Edit: Give Oscar an upvote as well, just below, who provided the documentation quote here.

    Given ARC, I suggest this means you should set your map view’s delegate to nil in your view controller’s dealloc.

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

Sidebar

Ask A Question

Stats

  • Questions 319k
  • Answers 319k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer ELMAH log4Net ASP.NET Health Monitoring May 14, 2026 at 12:08 am
  • Editorial Team
    Editorial Team added an answer Unless you specifically decorate your class with the DataContract attribute… May 14, 2026 at 12:08 am
  • Editorial Team
    Editorial Team added an answer To host ASP.NET content (such as .aspx pages) from your… May 14, 2026 at 12:08 am

Related Questions

I have a MKMapView that has a number of annotations. Selecting the pin displays
I have a MKMapView with annotations on it and it works fine. I have
I need to simulate how my application will look when a user is driving
Greetings! I'm attempting to use MKMapView without any Apple code samples, though there are
I have a strange(?) crash after releasing MKMapView. MKMapView is a subview in my

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.