i want to show multiple pins on my MapView all with Animation of Dropping pin so how it is possible if any body have sample code then please send send link.i am new in this field.Thanks in Advance.
Asked
Active
Viewed 3,286 times
3 Answers
2

Swapnil Luktuke
- 10,385
- 2
- 35
- 58
-
1Simply call addAnnotations on your MKMapView with an array of all the MKAnnotationViews. If you want the drop animation, set animatesDrop to true – Swapnil Luktuke Jun 07 '10 at 13:48
0
Just as you show single pin.. keep the code for single pin in Loop and pass different longitude latitude in loop.. You will get the pins at different location

Suresh Varma
- 9,750
- 1
- 60
- 91
-1
if([points retainCount] > 0)
{
[points release];
points = nil;
}
if([annotationAry retainCount] > 0)
{
[annotationAry release];
annotationAry = nil;
}
points = [[NSMutableArray alloc]init];
annotationAry = [[NSMutableArray alloc]init];
for(int i=0;i<[longitudeary count];i++)
{
CLLocation* currentLocation1 = [[CLLocation alloc] initWithLatitude:[[latitudeary objectAtIndex:i]doubleValue] longitude:[[longitudeary objectAtIndex:i]doubleValue]];
[points addObject:currentLocation1];
}
for(int i=0;i<[points count];i++)
{
// CREATE THE ANNOTATIONS AND ADD THEM TO THE MAP
CSMapAnnotation* annotation = nil;
// create the start annotation and add it to the array
annotation = [[[CSMapAnnotation alloc] initWithCoordinate:[[points objectAtIndex:i] coordinate]
annotationType:CSMapAnnotationTypeImage
title:@"123456..."
shID:[shIDary objectAtIndex:i]
catID:[catIDary objectAtIndex:i]
ciggUse:[ciggaretteUSEary objectAtIndex:i]
wifiUse:[wifiUSEary objectAtIndex:i]
controller:self]autorelease];
[annotationAry addObject:annotation];
}
[mapViewmy addAnnotations:[NSArray arrayWithArray:annotationAry]];

Bill the Lizard
- 398,270
- 210
- 566
- 880

Ankit Vyas
- 7,507
- 13
- 56
- 89
-
Do not use retainCount, it does not work the way shown! See this answer: [When to use -retainCount?](https://stackoverflow.com/a/4636477/451475). Also see: [retainCount is useless](http://www.friday.com/bbum/2011/12/18/retaincount-is-useless/), [When to use -retainCount?](http://sdarlington.github.io) and/or [When to use the retainCount method](http://iosdevelopertips.com/core-services/when-to-use-the-retaincount-method.html). – zaph May 14 '19 at 18:07