Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Don't forget to include #import <MapKit/MapKit.h> and MapKit.framework
- - (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath
- {
- MKMapView *mapa = (MKMapView *) [cell viewWithTag:TAG_CELL_MAP];
- NSManagedObject *managedObject = [self.fetchedResultsController objectAtIndexPath:indexPath];
- double latitude = [[managedObject valueForKey:@"photo_latitude"] doubleValue];
- double longitude = [[managedObject valueForKey:@"photo_longitude"] doubleValue];
- CLLocationCoordinate2D location = CLLocationCoordinate2DMake(latitude, longitude);
- MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(location,MAP_ZOOM_DISTANCE_X,MAP_ZOOM_DISTANCE_Y);
- [mapa setRegion:region animated:NO];
- MKPointAnnotation *annotationPoint = [[MKPointAnnotation alloc] init];
- annotationPoint.coordinate = location;
- annotationPoint.title = @"Pic";
- annotationPoint.subtitle = @"Naino naaaai";
- [mapa addAnnotation:annotationPoint];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement