【发布时间】:2011-09-20 03:40:07
【问题描述】:
我有一个符合 MKAnnotation 类的 AddressAnnotation 类。我使用 MKReverseGeocoderDelegate 方法从用户的位置获取地址。在那个代表中,我放下了别针。我将pin设置为可拖动,当调用下面的方法时,我再次启动反向地理编码器。
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view didChangeDragState:(MKAnnotationViewDragState)newState fromOldState:(MKAnnotationViewDragState)oldState {
if (newState == MKAnnotationViewDragStateEnding) {
CLLocationCoordinate2D newCoordinate = view.annotation.coordinate;
MKReverseGeocoder *reverseGeocoder = [[MKReverseGeocoder alloc] initWithCoordinate:newCoordinate];
reverseGeocoder.delegate = self;
[reverseGeocoder start];
}
}
它适用于大约 3 针拖动,直到我收到以下错误。我不确定这意味着什么或发生了什么。任何帮助,将不胜感激。谢谢!
“AddressAnnotation 类的实例 0x1b7ac0 已被释放,而键值观察者仍向其注册。观察信息被泄露,甚至可能被错误地附加到其他对象。在 NSKVODeallocateBreak 上设置断点以在调试器中停止。这是当前的观察信息:"
【问题讨论】:
标签: iphone