You could try this way... Make sure in your presenceArray
dictionaries are getting stored.
-(void)getPresenceData {
for(NSDictionary *dictObj in appDelegate.presenceArray) // this array that has dictionaries
{
annotation = [[Annotation alloc]init]; // Annotation Class
annotation.coordinate = CLLocationCoordinate2DMake([[dictObj valueForKey:@"latitudeValue"]doubleValue], [[dictObj valueForKey:@"longitudeValue"]doubleValue]);
annotation.title = [dictObj objectForKey:@"fromUser"];
[self.mapview addAnnotation:annotation];
}
}
As you are already looping than you dont need to create array of annotation objects.. You can add directly them to map as i did in above code..