views:

177

answers:

1

I'm trying to remove annotaenter code heretion 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): message 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?

A: 

Turns out my MKPinAnnotationView was set to autorelease.

tuzzolotron