Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 03-26-2009, 03:50 PM   #5 (permalink)
lapse
New Member
 
Join Date: Aug 2008
Posts: 211
Default

It's not created automatically. You need to implement this delegate method which will itself be called automatically by the MKMapView:

Code:
- (MKAnnotationView *) mapView: (MKMapView *) mapView viewForAnnotation: (id<MKAnnotation>) annotation
{
        MKPinAnnotationView *pin = (MKPinAnnotationView *) [self.mapView dequeueReusableAnnotationViewWithIdentifier: @"asdf"];
        if (pin == nil)
        {
                pin = [[[MKPinAnnotationView alloc] initWithAnnotation: annotation reuseIdentifier: @"asdf"] autorelease];
        }
        else
        {
                pin.annotation = annotation;
        }
        pin.pinColor = MKPinAnnotationColorRed;
        pin.animatesDrop = YES;
        return pin;
}
lapse is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,806
Threads: 89,205
Posts: 380,619
Top Poster: BrianSlick (7,129)
Welcome to our newest member, philipmores95
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:19 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.