Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xcode HandleLongPress:UIPopoverController解除锁定,而popover仍然可见_Xcode_Popover_Mkannotationview - Fatal编程技术网

Xcode HandleLongPress:UIPopoverController解除锁定,而popover仍然可见

Xcode HandleLongPress:UIPopoverController解除锁定,而popover仍然可见,xcode,popover,mkannotationview,Xcode,Popover,Mkannotationview,我正在尝试开发一个Mapkit应用程序。有一张地图,地图上有很多注释。如果我触摸其中一个注释,我的应用程序将显示来自故事板的自定义弹出框。如果我在popover处于活动状态时触摸视图上的另一个位置,popover将毫无问题地消失 但是,如果我触摸其中一个注释并在不松开手指的情况下将手指移出注释,我就得到了错误 2014-08-01 11:33:34.160 notamTR[1101:60b] *** Terminating app due to uncaught exception 'NSGen

我正在尝试开发一个Mapkit应用程序。有一张地图,地图上有很多注释。如果我触摸其中一个注释,我的应用程序将显示来自故事板的自定义弹出框。如果我在popover处于活动状态时触摸视图上的另一个位置,popover将毫无问题地消失

但是,如果我触摸其中一个注释并在不松开手指的情况下将手指移出注释,我就得到了错误

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

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