MapKit: Cannot remove an observer exception

Originator:futuretap
Number:rdar://9832987 Date Originated:25-Jul-2011 12:10 PM
Status:Duplicate/8851197/Closed Resolved:
Product:iPhone Product Version:4.3.4
Classification:Crash/Hang/Data Loss Reproducible:Unable
 
We're receiving a number of crash reports from our users with this exception:

*** Terminating app due to uncaught exception 'NSRangeException', reason: 'Cannot remove an observer <MKAnnotationContainerView 0x56d4190> for the key path "title" from <POI 0x44862e0> because it is not registered as an observer.'

We believe the root of the problem lies in MapKit. Please see the attached crash reports.

Steps to Reproduce:
Unable to reproduce yet.

Expected Results:

Actual Results:

Regression:
We've seen this since a long time with all iOS releases all the way up to 4.3.4.

Comments

found the reason

I finally found the reason. I wrote to the title and subtitle properties from background threads which seems to be a no-go. If I make sure to only set it from the main thread, the problem seems to go away.

Since objects are model objects, it is not immediately obvious that they fall under the UI=mainThread rule. So please include a little notice in the documentation.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!