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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:21:54+00:00 2026-05-21T02:21:54+00:00

When my view goes away I get the following message: An instance 0x1c11e0 of

  • 0

When my view goes away I get the following message:

An instance 0x1c11e0 of class MKAnnotationView was deallocated while key value observers were still registered with it. Observation info was leaked, and may even become mistakenly attached to some other object. Set a breakpoint on NSKVODeallocateBreak to stop here in the debugger. Here's the current observation info:

(
Context: 0x0, Property: 0x1e98d0>
)

The code that defines and starts the reverse geocoding is:

geo=[[MKReverseGeocoder alloc] initWithCoordinate:droppedAt];
        geo.delegate=self;
        [geo start];

I have tried setting geo.delegate to nil right before the I dismiss the view. That would be too easy. I have also tried:

for (id <MKAnnotation> annotation in mvMap.annotations) {
    [[mvMap viewForAnnotation:annotation] removeObserver:self forKeyPath:@"selected"];
}

Which throws an error that says:

* Terminating app due to uncaught exception ‘NSRangeException’, reason: ‘Cannot remove an observer for the key path “selected” from because it is not registered as an observer.

My view for annotation code is:

-(MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation {
    MKAnnotationView *aView;

    aView=(MKAnnotationView *) [mapView dequeueReusableAnnotationViewWithIdentifier:annotation.title];
    if (aView==nil) 
        aView=[[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:annotation.title] autorelease];
    else
        aView.annotation=annotation;
    [aView setImage:[UIImage imageNamed:selIcon]];
    aView.canShowCallout=TRUE;
    aView.draggable=YES;
    return aView;
}

I’m sort of pushing buttons and flipping switches here while spinning in. Any idea of what I can do here?

  • 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-21T02:21:55+00:00Added an answer on May 21, 2026 at 2:21 am

    You may have multiple issues, here. For every delegate you set up, you should clear it at dealloc. For every observer you set up, you should clear that, same with Notifications, etc.

    So your dealloc should have (typed in web browser, you may have to adjust):

    - (void) dealloc
    {
         [[NSNotificationCenter defaultCenter] removeObserver: self];
         for (id <MKAnnotation> annotation in mvMap.annotations)
         {
              // remove all observers, delegates and other outward pointers.
              [[mvMap viewForAnnotation:annotation] removeObserver: self forKeyPath: path];
         }
    
         gel.delegate = nil;
         // etc., your other stuff
         [super dealloc];  // Only in non-ARC legacy code.  Modern stuff skips this.
    }
    

    Go through your setup (likely in viewDidLoad) and make sure that you un-do everything that you did in there. Specifically anything that triggers a callback.

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

Sidebar

Related Questions

Probably a stupid question, but here goes. In my view, I have the following
My django view goes through a list , uses regex to detect specific elements
I have a table view, when a row is selected it goes on to
I have a very simple viewmodel class, and a strongly typed view (which uses
I'm producing a brick every second. When you tap it, it goes away. My
I have the following code inside a partial view: @if (Request.IsAuthenticated) { Hello, @Html.ActionLink(User.Identity.Name,
View History on an file in a branch show only changes since the branch.
View Looks Like This <?=form_open_multipart('upload/process');?> <input type=file multiple=multiple name=userfile[] id=userfile /> <?=form_submit('upload', 'Upload');?> <?=form_close();?>
public View getView(int position, View convertView, ViewGroup parent) { Button btn; if (convertView ==
The View.remove() function in backbone js removes the container element of the view itself

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.