MKMapView crash on removeAnnotation
I'm trying to remove annotaenter code here
tion some a MKMapView but am crashing on this line:
[self.mapView removeAnnotation:p];
p is an object that implements the MKAnnotation protocol and already has an annotation on that map.
This is the message I'm getting when I crash:
objc[46534]: FREED(id): messa开发者_JAVA百科ge release sent to freed object=0x4319640 Program received signal: “EXC_BAD_INSTRUCTION”. (gdb)
The backtrace looks like so:
(gdb) bt
#0 0x951424b4 in _objc_error ()
#1 0x951424ea in __objc_error ()
#2 0x951407dc in _freedHandler ()
#3 0x000786f6 in -[NSConcreteMapTable removeObjectForKey:] ()
#4 0x00003970 in -[MapViewController horizontalPickerVC:toggleGroup:enabled:] (self=0x4322a00, _cmd=0x24349, picker=0x43248c0, groupId=3, enabled=0 '\0') at /Users/me/Desktop/FanMapper/fanmapper/Classes/MapViewController.m:183
Any ideas?
Turns out my MKPinAnnotationView was set to autorelease.
精彩评论