PDA

View Full Version : overriding of delegate method?




MACloop
Dec 11, 2009, 02:24 AM
Hello!
I have a mapview and have definied my own class for annotations. To get it work properly, I had to override the "standard" method:
- (MKAnnotationView *)mapView: (MKMapView *)mapView viewForAnnotation: (id <MKAnnotation>)annotation{

and made it looking for my kind of objects like this:
- (MKAnnotationView *)mapView: (MKMapView *)mapView viewForAnnotation:(Annotations*)annotation{

My question:
Is it ok to override a method like this? Or may this lead to some kind of conflictes or other problems? It seem to work both in the sim and on my device so far, but i just wanted to check this a bit more.

Thanks in advance for any ideas or tips!
MACloop



kainjow
Dec 11, 2009, 09:49 AM
I would leave the method the same, but inside it cast the value to what you want.

MACloop
Dec 15, 2009, 03:23 AM
I would leave the method the same, but inside it cast the value to what you want.

that worked all right - thanks!