The doco for selectedMarker
says:
The marker that is selected. Setting this property selects a particular marker, showing an info window on it. If this property is non-nil, setting it to nil deselects the marker, hiding the info window. This property is observable using KVO.
So, you could use Key Value Observing to be notified of changes to selectedMarker
. If you use NSKeyValueObservingOptionOld
when setting up KVO (described in more detail here), you will be notified of the old value, ie the marker which was deselected.