HandleLongPress:UIPopoverController dealloc到达,而popover仍然可见

时间:2014-08-01 08:47:34

标签: xcode popover mkannotationview

我正在尝试开发Mapkit应用。这张地图上有一张地图,很多注释。如果我触摸其中一个注释,我的应用程序将从故事板显示自定义弹出窗口。如果我在弹出窗口处于活动状态时触摸视图上的其他位置,则弹出窗口将消失,没有任何问题。

但是,如果我触摸其中一个注释并将我的手指移出注释而不释放我的手指,我就会收到错误。

2014-08-01 11:33:34.160 notamTR[1101:60b] *** Terminating app due to uncaught exception 'NSGenericException', reason: '-[UIPopoverController dealloc] reached while popover is still visible.'
*** First throw call stack:
(
    0   CoreFoundation                      0x01b231e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x018208e5 objc_exception_throw + 44
    2   CoreFoundation                      0x01b22fbb +[NSException raise:format:] + 139
    3   UIKit                               0x00ae195e -[UIPopoverController dealloc] + 86
    4   libobjc.A.dylib                     0x01831692 _ZN11objc_object17sidetable_releaseEb + 268
    5   libobjc.A.dylib                     0x01830e81 objc_release + 49
    6   myMap                               0x0000b82d -[ViewController mapView:didSelectAnnotationView:] + 1885
    7   MapKit                              0x0017799d -[MKMapView annotationManager:didSelectAnnotationRepresentation:] + 704
    8   MapKit                              0x001ae9b8 -[MKAnnotationManager selectAnnotation:animated:avoid:] + 715
    9   MapKit                              0x001ae6e8 -[MKAnnotationManager selectAnnotation:animated:] + 75
    10  MapKit                              0x00165206 -[MKMapView handleLongPress:] + 993
    11  UIKit                               0x0087c4f4 _UIGestureRecognizerSendActions + 230
    12  UIKit                               0x0087b168 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 383
    13  UIKit                               0x0087cbdd -[UIGestureRecognizer _delayedUpdateGesture] + 60
    14  UIKit                               0x0088013d ___UIGestureRecognizerUpdate_block_invoke + 57
    15  UIKit                               0x008800be _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 317
    16  UIKit                               0x008767ac _UIGestureRecognizerUpdate + 199
    17  UIKit                               0x00521a5a -[UIWindow _sendGesturesForEvent:] + 1291
    18  UIKit                               0x00522971 -[UIWindow sendEvent:] + 1021
    19  UIKit                               0x004f45f2 -[UIApplication sendEvent:] + 242
    20  UIKit                               0x004de353 _UIApplicationHandleEventQueue + 11455
    21  CoreFoundation                      0x01aac77f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
    22  CoreFoundation                      0x01aac10b __CFRunLoopDoSources0 + 235
    23  CoreFoundation                      0x01ac91ae __CFRunLoopRun + 910
    24  CoreFoundation                      0x01ac89d3 CFRunLoopRunSpecific + 467
    25  CoreFoundation                      0x01ac87eb CFRunLoopRunInMode + 123
    26  GraphicsServices                    0x032df5ee GSEventRunModal + 192
    27  GraphicsServices                    0x032df42b GSEventRun + 104
    28  UIKit                               0x004e0f9b UIApplicationMain + 1225
    29  myMap                               0x0001c37c main + 92
    30  libdyld.dylib                       0x020e4701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

1 个答案:

答案 0 :(得分:0)

这个答案已经很晚了,但对于那些寻找解决方案的人:尝试创建一个storong属性来保存这个popover,然后在贴上地图附件时使用self.popover引用使用内容初始化它