gpt4 book ai didi

ios - 当尝试删除基于 iOS 6.1 的所有 MKAnnotations 时,MapKit 上会随机崩溃。

转载 作者:行者123 更新时间:2023-12-02 02:51:20 24 4
gpt4 key购买 nike

使用基于iOS6.1的MapKit,当我尝试删除所有MKAnnotations然后弹出 map View Controller 时,应用程序会随机崩溃(发生率非常低)。从崩溃日志来看,这似乎是一个观察者问题,任何经历过类似问题的人请给我一些见解,任何想法或讨论将不胜感激。提前致谢。

附注:

UIMapView 是我的应用程序中的单例,仅创建一次。

2013-08-13 15:11:59.025 CHSP[9129:c07] CRASH: Cannot remove an observer <MKAnnotationContainerView 0xb8e5120> for the key path "title" from <MKUserLocation 0xbab3440> because it is not registered as an observer.

2013-08-13 15:11:59.060 CHSP[9129:c07] Stack Trace: (
0 CoreFoundation 0x028ff02e __exceptionPreprocess + 206
1 libobjc.A.dylib 0x02030e7e objc_exception_throw + 44
2 CoreFoundation 0x028fedeb +[NSException raise:format:] + 139
3 Foundation 0x01a84a89 -[NSObject(NSKeyValueObserverRegistration) _removeObserver:forProperty:] + 790
4 Foundation 0x01a8471d -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:] + 105
5 MapKit 0x009194f9 -[MKAnnotationContainerView _unregisterObserverForBubbleAnnotation:] + 116
6 MapKit 0x00919704 -[MKAnnotationContainerView setBubbleAnnotationView:] + 99
7 MapKit 0x0091925d -[MKAnnotationContainerView _removeBubbleWithAnimation:tellDelegate:] + 247
8 MapKit 0x0091b114 -[MKAnnotationContainerView _deselectAnnotationViewWithAnimation:tellDelegate:] + 128
9 MapKit 0x0091b1e1 -[MKAnnotationContainerView _deselectAnnotationView] + 49
10 MapKit 0x0092198e -[MKAnnotationContainerView _removeAnnotationView:updateCollections:] + 395
11 MapKit 0x009217fe -[MKAnnotationContainerView _removeAnnotationView:] + 48
12 MapKit 0x00921490 -[MKAnnotationContainerView removeAnnotation:] + 375
13 MapKit 0x00921538 -[MKAnnotationContainerView removeAnnotations:] + 160
14 MapKit 0x0090f8bd -[MKMapView removeAnnotations:] + 58
15 CHSP 0x00077fd5 -[UPNewMapViewController removeAllAnnotations] + 101
16 CHSP 0x00076640 -[UPNewMapViewController dealloc] + 64
17 UIKit 0x01055480 -[UIViewController release] + 93
18 libobjc.A.dylib 0x020430c3 objc_release + 51
19 libobjc.A.dylib 0x02043bd9 _ZN12_GLOBAL__N_119AutoreleasePoolPage3popEPv + 555
20 CoreFoundation 0x028a1468 _CFAutoreleasePoolPop + 24
21 CoreFoundation 0x028a5afd __CFRunLoopRun + 1933
22 CoreFoundation 0x028a4f44 CFRunLoopRunSpecific + 276
23 CoreFoundation 0x028a4e1b CFRunLoopRunInMode + 123
24 GraphicsServices 0x02c927e3 GSEventRunModal + 88
25 GraphicsServices 0x02c92668 GSEventRun + 104
26 UIKit 0x00f7753c UIApplicationMain + 1211
27 CHSP 0x0009d9a2 main + 130
28 CHSP 0x00002f55 start + 53
)

2013-08-13 15:11:59.061 CHSP[9129:c07] *** Terminating app due to uncaught exception 'NSRangeException', reason: 'Cannot remove an observer <MKAnnotationContainerView 0xb8e5120> for the key path "title" from <MKUserLocation 0xbab3440> because it is not registered as an observer.'

最佳答案

我自己修好了。最初我尝试使用另一张图像来显示用户当前位置而不是 Mapkit 默认图像,似乎这不是一个好主意。

关于ios - 当尝试删除基于 iOS 6.1 的所有 MKAnnotations 时,MapKit 上会随机崩溃。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18244414/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com