Limit to 10 number of annotations in mapkit!

Posted by teddafan on Stack Overflow See other posts from Stack Overflow or by teddafan
Published on 2010-05-30T16:59:37Z Indexed on 2010/05/30 17:02 UTC
Read the original article Hit count: 190

Hi, I have all my annotations(as nsdictionnaries) in an array , and the users add them one by one by tapping on an icon. I want to make it impossible after adding 10 annotations (there is 110).

Is it here i have to make something?:

-(IBAction) plusButtonTapped: (id) sender {

NSDictionary *poiDict = [poiArray objectAtIndex:nextPoiIndex++];
CLLocationCoordinate2D poiCoordinate;
poiCoordinate.latitude = [[poiDict valueForKey:@"workingCoordinate.latitude"] doubleValue];
poiCoordinate.longitude = [[poiDict valueForKey:@"workingCoordinate.longitude"] doubleValue];
MyMapAnnotation *poiAnnotation = [[MyMapAnnotation alloc]
                                  initWithCoordinate:poiCoordinate
                                  title:[poiDict valueForKey:@"Subtitle"]
                                  color:MKPinAnnotationColorRed ];
[mapView addAnnotation:poiAnnotation];
[self adjustMapZoom];

}

Thank you for your help in advance,

teddafan

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c