Search code examples
objective-cmkmapviewmkannotationmkannotationview

MKMapview place pin at location (long/lat)


I have latitude and long values and I need to be able to drop a pin at this location.

Can anybody provide some advice on how to go about this?


Solution

  • Find the below very simple solution to drop the pin at given location define by CLLocationCoordinate2D

    Drop Pin on MKMapView

    Edited:

    CLLocationCoordinate2D  ctrpoint;
    ctrpoint.latitude = 53.58448;
    ctrpoint.longitude =-8.93772;
    AddressAnnotation *addAnnotation = [[AddressAnnotation alloc] initWithCoordinate:ctrpoint]; 
    [mapview addAnnotation:addAnnotation];
    [addAnnotation release];