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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:40:39+00:00 2026-05-24T07:40:39+00:00

I am running the leaks tool in instruments on a device. I am getting

  • 0

I am running the leaks tool in instruments on a device. I am getting leaks of MKReverseGeocoder, MKReverseGeocoderInternal, and NSCFString (Points to -(void)reverseGeocoder: didFindPlacemark). I have been working on these leaks for over 2 days and cannot find a solution. If anyone can point me in the right direction I would be very gracious.

.H

@interface ReviewViewController : UIViewController <MKMapViewDelegate, MKReverseGeocoderDelegate,MKAnnotation > {
    IBOutlet UIImageView *_changingStationIV;
    IBOutlet UIImageView *_feedingAreaIV;
    IBOutlet UIImageView *_highChairIV;
    IBOutlet MKMapView *_mapView;
    MKReverseGeocoder *_reverseGeocoder;
    SGFeature *_place;
    MKPlacemark *_loc;

}

@property(nonatomic,retain)IBOutlet UIImageView *changingStationIV;
@property(nonatomic,retain)IBOutlet UIImageView *feedingAreaIV;
@property(nonatomic,retain)IBOutlet UIImageView *highChairIV;
@property(nonatomic,retain)IBOutlet MKMapView *mapView;
@property(nonatomic,retain) MKReverseGeocoder *reverseGeocoder;
@property(nonatomic,retain) SGFeature *place;
@property(nonatomic,retain) MKPlacemark *loc;

@end

.M

        @implementation ReviewViewController
     @synthesize changingStationIV=_changingStationIV,feedingAreaIV=_feedingAreaIV, highChairIV= _highChairIV, reverseGeocoder= _reverseGeocoder, mapView=_mapView,loc=_loc,coordinate=_coordinate,place=_place;

     // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
    - (void)viewDidLoad {
        [super viewDidLoad];
        NSLog(@"ViewDidLoad");

    NSLog(@"CURRENT PLACE %@",  [[self.place asDictionary] description]);

    NSDictionary *props = [self.place properties];

    self.title = [props objectForKey:@"name"];

    NSLog(@"changingStation: %@", [props objectForKey:@"changingStation"]);

    NSLog(@"feedingArea: %@", [props objectForKey:@"feedingArea"]);

    NSLog(@"highChair: %@", [props objectForKey:@"highChair"]);

    if ([[props objectForKey:@"changingStation"] boolValue]==YES) {
        self.changingStationIV.image = [UIImage imageNamed:@"check.png"];
    }else {
        self.changingStationIV.image = [UIImage imageNamed:@"x.png"];
    }
    if ( [[props objectForKey:@"feedingArea"] boolValue]==YES) {
        self.feedingAreaIV.image = [UIImage imageNamed:@"check.png"];
    }else {
        self.feedingAreaIV.image = [UIImage imageNamed:@"x.png"];
    }
    if ( [[props objectForKey:@"highChair"] boolValue]==YES) {
        self.highChairIV.image = [UIImage imageNamed:@"check.png"];
    }else {
        self.highChairIV.image = [UIImage imageNamed:@"x.png"];
    }

    SGPoint *point = (SGPoint*)[self.place geometry];
    CLLocationCoordinate2D locCoord = CLLocationCoordinate2DMake(point.latitude, point.longitude);
    NSDictionary *locDict = [NSDictionary dictionaryWithObject:[props objectForKey:@"name"] forKey:@"Country"];
    self.loc = [[MKPlacemark alloc] initWithCoordinate:locCoord addressDictionary:locDict];
    [self.mapView addAnnotation:self.loc];


    MKUserLocation *userLocation = self.mapView.userLocation;
    CLLocationCoordinate2D coord = userLocation.location.coordinate;
    [self.mapView setCenterCoordinate:coord animated:YES];

    MKCoordinateRegion region;
    MKCoordinateSpan span;
    region.center = locCoord;
    span.latitudeDelta =0.005334;
    span.longitudeDelta = 0.011834;
    region.span = span;

    [self.mapView setCenterCoordinate:locCoord animated:YES];
    [self.mapView setRegion:region animated:YES];


        self.reverseGeocoder = [[MKReverseGeocoder alloc] initWithCoordinate:locCoord];
        self.reverseGeocoder.delegate = self;
            [self.reverseGeocoder start];



    }


        -(void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error{

        }

        -(void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark{

                self.mapView.userLocation.title = placemark.title;

        }   


        - (void)didReceiveMemoryWarning {
            // Releases the view if it doesn't have a superview.
            [su

per didReceiveMemoryWarning];

        // Release any cached data, images, etc. that aren't in use.
    }

    - (void)viewDidUnload {
        [super viewDidUnload];
        // Release any retained subviews of the main view.
        // e.g. self.myOutlet = nil;

    NSLog(@"ViewDidUnload");


        self.changingStationIV =nil;
        self.feedingAreaIV=nil;
        self.highChairIV=nil;
        self.reverseGeocoder=nil;
        self.place=nil;
        self.loc=nil;


    }


    - (void)dealloc {

        NSLog(@"Review-Dealloc");


        self.reverseGeocoder=nil;
        self.mapView=nil;
        self.changingStationIV =nil;
        self.feedingAreaIV=nil;
        self.highChairIV=nil;
        self.place=nil;
        self.loc=nil;


        [super dealloc];

    }


    @end
  • 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-24T07:40:40+00:00Added an answer on May 24, 2026 at 7:40 am

    You are certainly leaking memory here:

        self.loc = [[MKPlacemark alloc] initWithCoordinate:locCoord 
                                         addressDictionary:locDict];
    

    Since you have defined loc as a retain property, assigning to it will call retaing on the argument, and you’ll end up with a MKPlacemark that ware retained and never released.

    I would change that line as follows:

        self.loc = [[[MKPlacemark alloc] initWithCoordinate:locCoord 
                                         addressDictionary:locDict] autorelease];
    

    Also, check carefullly your code for this pattern, since as @omz suggests, you are doing it also when assigning to reverseGeocoder.

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

Sidebar

Related Questions

Update: this leak has been solved. If you are getting similar leaks and your
After running the Leaks Instruments on an app that I am developing, I see
Running Instruments on my iPad app found 2 leaks, except I cannot understand where
I'm running leaks through Instruments on my iPhone app and I'm seeing a lot
I was running Leaks tool and discovered a massive leak in my Dictionary mutableDeepCopy
I'm running valgrind to look for memory leaks. I have alloc'd two global variables
Can somebody help me trace these CoreVideo memory leaks when running Instruments in XCode?
I could use some help interpreting results from the Instruments Leaks tool. This is
I am using NSKeyedUnarchiver unarchiveObjectWithFile: to read in application data. When running with Leaks
Running ipconfig /all shows a Teredo Tunneling Pseudo-Interface. What is that? Does this have

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.