After JSON parsing -viewForAnnotation shows only ONE single annotation on MKMapView

前端 未结 2 1182
悲哀的现实
悲哀的现实 2020-12-12 05:38

I need to show on my MkMapView about 10 locations (and respective annotations) and after pressing a button I need to add new different annotations according to different JSO

2条回答
  •  我在风中等你
    2020-12-12 06:11

    What is also really important to note (because it was very hard to find that error and I sat the whole last night in front of this...) is to check if your object that conforms to MKAnnotation has some master base class that imlements the methods isEqual and / or hash on only the data of the base class and you do not overwrite that in your base class. This was my problem and thus isEqual returned YES for all annotations and THUS it showed always only one annotation on the map. I couldn't find any hint on the internet about this so I will leave at least this comment here for poor people in the same situation.

提交回复
热议问题