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 09-17-2009, 11:18 AM   #15 (permalink)
pwb
Registered Member
 
Join Date: Sep 2009
Posts: 2
Default

Quote:
Originally Posted by lapse View Post
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;
}
Have you seen evidence that AnnotationViews are actually getting placed on the reuse queue? I have code very similar to the above, but placed in NSLog statements to see when I was reusing and creating new annotations. And it never reuses an annotation.
pwb is offline   Reply With Quote
 

» Advertisements
» Online Users: 278
17 members and 261 guests
ADY, aikhan, AppAnnex, astalavista, chemistry, dcool, HemiMG, ilmman, leahov, mer10, NSeven, padsoftware, Paul10, pavanindira, Promo Dispenser, RoryHarvey, touchcream
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,877
Threads: 89,219
Posts: 380,707
Top Poster: BrianSlick (7,129)
Welcome to our newest member, peterkessler45
Powered by vBadvanced CMPS v3.1.0

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