Quantcast
Channel: Developer Feed - Snippet
Viewing all articles
Browse latest Browse all 178

How to create a PINAnnotationView in IOS?

$
0
0
  1.   Annotation*anno =[[[Annotation alloc] init] autorelease];       
  2. anno.coordinate= xxx// get it map view;        
  3.  
  4. anno.title= @"Current Location";
  5.  anno.subtitle=[NSString stringWithFormat:@"%f, %f", anno.coordinate.latitude, anno.coordinate.longitude];           
  6.  
  7. NSString *defaultPinID = @"xyz..";
  8. pinView =[[[MKPinAnnotationView alloc] initWithAnnotation:anno reuseIdentifier:defaultPinID] autorelease];
  9.  
  10. // customize the pin
  11. pinView.image=[UIImage imageNamed:@"custom_pin.png"];
  12. pinView.opaque= NO;
  13. pinView.canShowCallout= YES;
  14. pinView.draggable= NO;
  15. pinView.annotation= anno;       

Viewing all articles
Browse latest Browse all 178

Trending Articles