I am trying to get picture locational information with this code:
NSArray* assetsA = [myAssetsProxy getAssets];
int assetIDX = 0;
int n = [assetsA count];
for(assetIDX = 0; assetIDX < n; assetIDX++)
{
ALAsset* asset = [assetsA objectAtIndex:assetIDX];
id value = [asset valueForProperty:ALAssetPropertyLocation];
if ([value isKindOfClass:[CLLocation class]]) {
CLLocation* l = (CLLocation*)value;
NSLog(@"%@", value);
float r = l.coordinate.longitude;
if(r < 180 && r > -180)
{
NSLog("Huray!!!");
}
}
}
but "r" variable always contains nan(0x400000) The location services are enabled for my app. Where is the problem?