2

I am getting below error, while adding annotation

An instance 0x21fcadd0 of class MKPointAnnotation 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: 0xb74f170> )

my code is below putting pin more than 100.

 if ([arrListing count] != 0) {
        for (int i = 0; i < [arrListing count]; i++) {


            Listing *obj = [arrListing objectAtIndex:i];
            NSLog(@"Title %@  long:%@  Lat:%@",obj.Title,obj.log,obj.lat);

            CLLocationCoordinate2D annotationCoord;

            annotationCoord.latitude = [obj.lat floatValue];
            annotationCoord.longitude = [obj.log floatValue];

                // do something
                MKPointAnnotation *annotationPoint = [[MKPointAnnotation alloc] init];
                annotationPoint.coordinate = annotationCoord;
                annotationPoint.title = obj.Title;
                //  annotationPoint.subtitle = obj.log;
                [mapView addAnnotation:annotationPoint];



        }
    }    
}

thank in advanced

Mohammed Ebrahim
  • 849
  • 1
  • 12
  • 22
  • Can you add some code so we can get an idea of what you are trying to do? – Andy Sinclair Jan 22 '13 at 14:11
  • This all looks fine. Can you show us where you're breaking this down and where the annotation would be deallocated? – Rob Jan 22 '13 at 14:28
  • Are all the longitudes between -180 and +180 and are all the latitudes between -90 and +90? –  Jan 22 '13 at 14:29
  • Al the longitudes between -180 and +180 and are all the latitudes between -90 and +90 are not bettween it. – Mohammed Ebrahim Jan 23 '13 at 07:41
  • 2
    So the latitudes are not all in the range -90 to +90? Invalid coordinates can cause that error. For example, see http://stackoverflow.com/questions/5872547/warning-in-custom-map-annotations-iphone. –  Jan 23 '13 at 14:20

1 Answers1

0

This means that you may have mistaken latitude and longitude.

Latitude should be between -90 and 90, and longitude should be between -180 and 180.

Enrico Susatyo
  • 19,372
  • 18
  • 95
  • 156