我在添加注释时遇到错误
类的实例 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];
}
}
}
感谢先进