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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

Thread: MKAnnotation
View Single Post
Old 07-29-2010, 07:47 PM   #10 (permalink)
Ovidius
Registered Member
 
Ovidius's Avatar
 
Join Date: Jun 2010
Posts: 77
Ovidius is on a distinguished road
Default

modded again to avoid mem leakz:

Code:
- (MKAnnotationView *)mapView:(MKMapView *)aMapView viewForAnnotation:(id <MKAnnotation>)anAnnotation 
{
	MKPinAnnotationView *pin = (MKPinAnnotationView *) [mapView dequeueReusableAnnotationViewWithIdentifier: @"StartPin"];
	if (pin == nil)
	{
		if ([anAnnotation isKindOfClass:[MapAnnotation class]])
		{
			MapAnnotation *theAnnotation = (MapAnnotation *)anAnnotation;
			if (theAnnotation.identifier == @"StartAnnotation")
			{
				MKPinAnnotationView *startAnnotationPin = [[MKPinAnnotationView alloc] initWithAnnotation:anAnnotation reuseIdentifier:@"StartPin"];
				startAnnotationPin.pinColor = MKPinAnnotationColorGreen;
				return startAnnotationPin;
			}
		}
	}
	return nil;
}
Ovidius is offline   Reply With Quote
 

» Advertisements
» Online Users: 372
10 members and 362 guests
amit.mangal, Domele, HemiMG, ipodphone, minglei, online-loans70, PavelSea, Sesio, thephotographer, Wharazhasri
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,568
Threads: 94,081
Posts: 402,751
Top Poster: BrianSlick (7,990)
Welcome to our newest member, online-loans70
Powered by vBadvanced CMPS v3.1.0

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