1

我有自定义覆盖的问题。问题是我无法识别错误代码,它随机发生

也许有人可以在这个堆栈上帮助我。什么是点数?

2012-07-30 02:02:01.187 MyApp[454:8107] -[MyRegionOverlay pointCount]: unrecognized selector sent to instance 0x5d7dab0
2012-07-30 02:02:01.190 MyApp[454:8107] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MyRegionOverlay pointCount]: unrecognized selector sent to instance 0x5d7dab0'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x016c15a9 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x01815313 objc_exception_throw + 44
    2   CoreFoundation                      0x016c30bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
    3   CoreFoundation                      0x01632966 ___forwarding___ + 966
    4   CoreFoundation                      0x01632522 _CF_forwarding_prep_0 + 50
    5   MapKit                              0x008186c4 _ZL20createPathForPolygonP9MKPolygon10MKMapPoint + 55
    6   MapKit                              0x00818817 -[MKPolygonView createPath] + 95
    7   MapKit                              0x0081d715 -[MKOverlayPathView drawMapRect:zoomScale:inContext:] + 79
    8   MapKit                              0x00838328 -[MKOverlayClusterView drawLayer:inContext:] + 1450
    9   QuartzCore                          0x00472b5e -[CALayer drawInContext:] + 143
    10  QuartzCore                          0x00489283 _ZL18tiled_layer_renderP16_CAImageProviderjjjjPv + 1648
    11  QuartzCore                          0x003d1eb2 _ZL21CAImageProviderThreadPjb + 475
    12  libSystem.B.dylib                   0x91bce781 _pthread_wqthread + 390
    13  libSystem.B.dylib                   0x91bce5c6 start_wqthread + 30
)
4

1 回答 1

1

错误意味着MKPolygonView您的叠加层中有一个。的polygon属性MKPolygonView设置为 的实例MyRegionOverlay。不幸的是,它不是它应该是MyRegionOverlay的子类。MKPolygon因此,当pointCount消息发送给MyRegionOverlay您时,您会收到一个运行时错误“无法识别的选择器”,因为MyRegionOverlay显然没有响应pointCount.

于 2012-07-30T00:53:44.850 回答