iOS overriding of delegate method?

MACloop

macrumors 6502
Original poster
May 18, 2009
393
0
Germany
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

Moderator emeritus
Jun 15, 2000
7,958
5
I would leave the method the same, but inside it cast the value to what you want.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.