I have a warning “MyAnnotation does not implement the MKAnnotation protocol” everytime I use this:
[mapView addAnnotation:annotation];
or
[mapView removeAnnotation:mapView.annotations];
Someone have an idea?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
(Assumed that you annotation object is an instance of MyAnnotation class)
MKMapView require that its annotation objects conform to
MKAnnotationprotocol to ensure they implement certain required methods – otherwise your application can produce errors in run-time. This protocol is defined as follows:That is your MyAnnotation class must define and implement
coordinateproperty and may also implement 2 optionaltitlemethods. To let compiler know that your class actually conforms to a protocol you must declare your class the following way: