How do I place another attribute to a MKAnnotation?
Posted
by kevin Mendoza
on Stack Overflow
See other posts from Stack Overflow
or by kevin Mendoza
Published on 2010-05-31T05:13:09Z
Indexed on
2010/05/31
5:22 UTC
Read the original article
Hit count: 335
for my app each annotation on a map corresponds to a mine locality. each mine has its own unique 7 digit integer identifier. I'm trying to add the property minesEntryNumber to the annotation so when the annotation is clicked on later I can bring up specific information on the selected annotation. This is part of my code:
for (id mine in mines)
{
//NSLog(@"in the loop");
workingCoordinate.latitude = [[mine latitudeInitial] doubleValue];
workingCoordinate.longitude = [[mine longitudeInitial] doubleValue];
iProspectAnnotation *tempMine = [[iProspectAnnotation alloc] initWithCoordinate:workingCoordinate];
[tempMine setTitle:[mine mineName]];
tempMine.minesEntryNumber = [mine entryNumber];
//other code for dealing with mine types and adding the annotation to the mapview
}
the code works fine without the "tempMine.minesEntryNumber = [mine entryNumber];" part. It loads the map and shows the annotations. however when I try and put this in it brings up an error. So how do I add this property to each annotation and how do I access it later in a different .m file?
© Stack Overflow or respective owner