overriding of delegate method?

Discussion in 'iOS Programming' started by MACloop, Dec 11, 2009.

  1. macrumors 6502

    Joined:
    May 18, 2009
    Location:
    Germany
    #1
    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
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    I would leave the method the same, but inside it cast the value to what you want.
     
  3. thread starter macrumors 6502

    Joined:
    May 18, 2009
    Location:
    Germany
    #3
    that worked all right - thanks!
     

Share This Page