Hi all.  I've been wrestling with a crash in our app for a while now.
It occurs when an MKMapView calls its delegate to get an annotation
view.  The problem is, there shouldn't be any MKMapView in existence.
The view containing it has long since been popped.

The MapView was part of a view loaded from a XIB, and it's popped when
the user presses the Back button.  But our app will very often crash
much later, when it returns from background in a new geographic
location, and the crash log shows it's in [MKMapView
annotationContainer:viewForAnnotation:] and there's no map on the
screen.

I've found several reports of this on the Web, and the consensus is
that something we don't know about is retaining the MKMapView; the
only solution is to set its delegate to nil before the delegate gets
blown away.

My question is why.  If this is expected of programmers, then why
aren't we expected to do this for ALL controls that have delegates?
Or are we?  Should I have known to do this somehow?  I don't see
instructions to do so in the documentation.

Thanks for any insight.

Gavin
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to