Search code examples
model-view-controllerios5mkmapviewmkannotation

When using MapKit, are MKAnnotations the model of MVC paradigm?


When using MapKit, are MKAnnotations the model of MVC paradigm? I mean, let's say I have locations (for instance, cinemas) and those can be shown using a map and a list (table view).
What is the model in this context?
I guess are Ciname instances, but MKMapView requires annotations (MKAnnotation and MKAnnotationView). Using the table I don't have problems, as I can use the model in cellForRow, but using MKMapView requires annotations.

Do I have to copy all cinemas to custom annotations?
I guess that's not normal. What do you think? basically what I don't understand is how to use the model view controller pattern properly in this scenario.


Solution

  • MkAnnotations is a protocol, so your objects (the modell) just must also implement that protocoll, that can work whitout copy.

    So yes your objects that i plement that MkAnnoation protocoll is the modell, related to MVC.

    This protocoll is neccessary for MkMapKit to have a coordinate for each object in the modell.