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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:11:34+00:00 2026-06-18T00:11:34+00:00

I have a MKMapView that expands (vertically) on tap (using UITapGestureRecognizer) and fires off

  • 0

I have a MKMapView that expands (vertically) on tap (using UITapGestureRecognizer) and fires off an api call on pan (using UIPanGestureRecoginizer).

Everything was working fine, until some time back, where on Panning, the app would crash, with hardly any useful info (or info that I could comprehend)

Exception breakpoints are on, and zombie objects have been enabled. On crashing, it never hits the exception breakpoint!

Here’s the log:
(Panning began, panning, panning ended are printed out based on the Pan gestureRecognizer states).
Right after panning ends, the app crashes.
(The map is yet to load all its tiles, and regionDidChangeAnimated is not called yet):

2013-01-17 14:46:04.396 MyApp[13126:c07] Panning Began
2013-01-17 14:46:04.412 MyApp[13126:c07] Panning
2013-01-17 14:46:04.412 MyApp[13126:c07] Panning
2013-01-17 14:46:04.557 MyApp[13126:c07] Panning
2013-01-17 14:46:04.606 MyApp[13126:c07] Panning
2013-01-17 14:46:04.691 MyApp[13126:c07] Panning Ended
2013-01-17 14:46:04.692 MyApp[13126:c07] *** -[MKMapViewPositioningChange hasChanges]: message sent to deallocated instance 0x139f7520

Here’s the backtrace i see after the crash:

(lldb) bt
* thread #1: tid = 0x1c03, 0x02a4fa97 CoreFoundation`___forwarding___ + 295, stop reason = EXC_BREAKPOINT (code=EXC_I386_BPT, subcode=0x0)
    frame #0: 0x02a4fa97 CoreFoundation`___forwarding___ + 295
    frame #1: 0x02a4f94e CoreFoundation`_CF_forwarding_prep_0 + 14
    frame #2: 0x01244d27 MapKit`-[MKMapView(UserPositioningInternal) _runPositioningChange] + 2037
    frame #3: 0x01242dd7 MapKit`-[MKMapView(UserPositioningInternal) _runPositioningChangeIfNeeded:] + 86
    frame #4: 0x01240220 MapKit`-[MKMapViewInternal runPositioningChangeIfNeeded] + 50
    frame #5: 0x01e2eb90 Foundation`__NSFireTimer + 97
    frame #6: 0x02a1f376 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
    frame #7: 0x02a1ee06 CoreFoundation`__CFRunLoopDoTimer + 534
    frame #8: 0x02a06a82 CoreFoundation`__CFRunLoopRun + 1810
    frame #9: 0x02a05f44 CoreFoundation`CFRunLoopRunSpecific + 276
    frame #10: 0x02a05e1b CoreFoundation`CFRunLoopRunInMode + 123
    frame #11: 0x03c897e3 GraphicsServices`GSEventRunModal + 88
    frame #12: 0x03c89668 GraphicsServices`GSEventRun + 104
    frame #13: 0x0132d65c UIKit`UIApplicationMain + 1211
    frame #14: 0x0001223d MyApp`main + 141 at main.m:16
    frame #15: 0x00002fc5 MyApp`start + 53

The crashes go away the moment i take the connection for the PanGestureRecognizer action method.

Is there a way to get rid of this crash while using the gesture recognizers? or is there a way to know that the map was tapped and panned, without using GestureRecognizers?

Any help/questions/answers/comments appreciated!


Update (Jan 19): This doesn’t seem to be an issue with the pan gesture recognizer at all. Now I am getting it to crash on after i try to add new annotations to the mapview, call [MapView setRegion: animated:], and crashes just before regionDidChangeAnimated is hit, with the same [MKMapViewPositioningChange hasChanges] log at the point where it crashes.


Update (Jan 23): I think I am quite sure whats happening. there is one chunk of code thats trying to set the region to include all the annotations in the visible rect of the MKMapView, and a few other locations, where I am calling [myMapView removeAnnotations:[myMapView annotations]]. And, my guess is that these two actions end up in a nasty mid-air collision, leaving no trail as to what lead to a crash. Will update the question with an answer if my hunch-fix passes QA

  • 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-18T00:11:35+00:00Added an answer on June 18, 2026 at 12:11 am

    As I had guessed earlier (second update to the question), this was an issue with trying the add set the map region to show all annotations, and removing all annotations simultaneously. if you are calling setRegion: animated: , make sure to check if the mapView has at least one annotation.

    Also, it’ll be helpful to use the following piece of code judiciously, especially if you are doing any type of animations on the map based on the annotations.

    [MKMapView removeAnnotations:[MKMapView annotations]];

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

Sidebar

Related Questions

I have an MKMapView that's supposed to track the user's location using a custom
I have a view that I am using as an overlay on a MKMapView
I have a MKMapView annotation object that has a right callout accessory detail disclosure
I have a label that overlays on an MKMapView . The only problem is,
As well as my question Removing MKMapView Annotations causes leaks. I have discovered that
I have a MKMapView that has a pin than when pressed shows the annotation's
For some reason my MKMapView gets an overlay sometimes that covers everything except the
I have an MKMapView that I am considering rotating in order to more conveniently
I have an MKMapView in my app and have a button that turns on
I have a MKMapView that queries a server and displays an array of MKAnnotations

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.