So `MKAnnotation’s. Fun stuff.
My questions:
What’s the difference between an annotation’s title and its subtitle and how does that affect the visual component of the annotation?
What’s the difference between a MKPinAnnotationView and a MKAnnotationView?
Are there different types of map annotations in iOS apart from pins?
Titleis main heading of your pin.The
subtitleis actually displaying the address/(common info) of the dropped pin.You can store other deeply information of related to title that is puted on pin.MKAnnotationis a protocol you need to adopt if you wish to show your object on aMKMapView. The coordinate property tellsMKMapViewwhere to place it. title and subtitle properties are optional but if you wish to show a callout view you are expected to implement title at a minimum.MKAnnotationViewvisually presents theMKAnnotationon theMKMapView. The image property can be set to determine what to show for the annotation. However you can subclass it and implementdrawRect:yourself.MKPinAnnotationViewis a subclass ofMKAnnotationViewthat uses a Pin graphic as the image property. You can set the pin color and drop animation.Don’t forget about the
leftCalloutAccessoryViewand therightCalloutAccessoryViewproperties ofMKAnnotationViewthat can be used to customize the callout view.