2

我在添加注释时遇到错误

类的实例 0x21fcadd0 已MKPointAnnotation被释放,而键值观察者仍向其注册。观察信息被泄露,甚至可能被错误地附加到其他对象上。在调试器中设置断点NSKVODeallocateBreak以在此处停止。

这是当前的观察信息:

(上下文:0x0,属性:0xb74f170>)

我的代码低于 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];



        }
    }    
}

感谢先进

4

1 回答 1

0

这意味着您可能弄错了纬度和经度。

纬度应该在 -90 到 90 之间,经度应该在 -180 到 180 之间。

于 2014-08-19T13:50:32.777 回答