General picture is bring up the information well. But there is no gps information on pictures in the filter is applied. Is there a way to fix?

- (void)getGPSLocation : (ALAsset*)asset
{
    NSMutableDictionary *imageMetadata = nil;
    NSDictionary *metadata = asset.defaultRepresentation.metadata;
    imageMetadata = [[NSMutableDictionary alloc] initWithDictionary:metadata];

    latitude = [[[imageMetadata objectForKey:@"{GPS}"]objectForKey:@"Latitude"]doubleValue];
    longitude = [[[imageMetadata objectForKey:@"{GPS}"]objectForKey:@"Longitude"]doubleValue];

    CLGeocoder *ceo = [[CLGeocoder alloc]init];
    CLLocation *loc = [[CLLocation alloc]initWithLatitude:latitude longitude:longitude]; //insert your coordinates

    addr = [NSString alloc];

    [ceo reverseGeocodeLocation: loc completionHandler:
     ^(NSArray *placemarks, NSError *error) {

         CLPlacemark *placemark = [placemarks objectAtIndex:0];

         NSString *locatedAt = [[placemark.addressDictionary valueForKey:@"FormattedAddressLines"] componentsJoinedByString:@", "];

         NSLog(@"I am currently at %@",locatedAt);
         addr = locatedAt;
         //         [_address setText:locatedAt];
         //         [self setPin:latitude longitude:longitude addr:addr];
     }];
}

Related posts

Recent Viewed