I am getting a warning in the below mentioned line:
[self.mapView addAnnotation:addressAnnotation];
The warning is:
Sending 'MapAnnotation *__strong' to parameter of incompatible type 'id<MKAnnotation>'
Since I referred similar kind of posts I have to mention that, the header file of this class includes <MKAnnotation>
and the forward declaration of MapAnnotation
class is also available.
Please suggest.
To get rid of the warning, you have two choices:
Declare the class of self (whatever that class is), in its @interface
statement, to conform to the protocol.
Suppress the warning by changing this:
[self.mapView addAnnotation:addressAnnotation];
to this:
[self.mapView addAnnotation:(id)addressAnnotation];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With