0

我正在使用 YHAnimatedCircleView ( http://yickhong-ios.blogspot.it/2012/04/animated-circle-on-mkmapview.html ) 在地图上显示动画圆圈。它适用于 iOS6,而我在使用 iOS7 时遇到了一些问题。

圆圈在地图上出现很长一段时间后,它返回给我以下错误:

CoreAnimation: warning, deleted thread with uncommitted CATransaction;

0   QuartzCore                          0x00fcfa96 _ZN2CA11Transaction4pushEv + 374
1   QuartzCore                          0x00fcfe72 _ZN2CA11Transaction15ensure_implicitEv + 316
2   QuartzCore                          0x0106791b _ZN2CA5Layer12begin_changeEPNS_11TransactionEjRP11objc_object + 37
3   QuartzCore                          0x0106914e _ZN2CA5Layer12set_positionERKNS_4Vec2IdEEb + 290
4   QuartzCore                          0x010692a9 -[CALayer setPosition:] + 68
5   QuartzCore                          0x010699af -[CALayer setFrame:] + 799
6   UIKit                               0x0126329c -[UIView(Geometry) setFrame:] + 302
7   UIKit                               0x01361d50 -[UIImageView _setViewGeometry:forMetric:] + 210
8   UIKit                               0x01361fae -[UIImageView setFrame:] + 63
9   SampleApp                              0x0001d331 -[YHAnimatedCircleView drawMapRect:zoomScale:inContext:] + 1329
10  MapKit                              0x00c1b8ff __43-[MKOverlayView overlay:drawKey:inContext:]_block_invoke + 847
11  MapKit                              0x00c1b572 -[MKOverlayView overlay:drawKey:inContext:] + 268
12  VectorKit                           0x0bff941d -[VKRasterOverlay drawKey:inContext:] + 61
13  VectorKit                           0x0bff75e5 __40-[VKRasterOverlayTileSource _queueDraw:]_block_invoke + 485
14  libdispatch.dylib                   0x0647d818 _dispatch_call_block_and_release + 15
15  libdispatch.dylib                   0x064924b0 _dispatch_client_callout + 14
4

2 回答 2

0

我不确切知道您的框架在做什么,但不应该在主线程中完成图层的绘制。因此,就像在讨论和解决的这个线程中一样,您应该只使用异步调度程序。

dispatch_async(dispatch_get_main_queue(), ^{
        [_mapView addOverlay:circle];
    });
于 2013-09-27T12:35:01.297 回答
0

这是一个为 iOS7 更新 YickHong 解决方案的示例。

https://github.com/jhurray/iOS7AnimatedMapOverlay

在 iOS7 中,您不能再将子视图添加到 MKOverlay。在这里查看代码,如果您有任何问题,请联系我 jeff@energ.io。

于 2014-02-05T01:28:15.180 回答