Possible Duplicate:
How can i avoid Location service in AlAssetLibrary? Can i retrieve files using AlAssetLibrary without using Location Service?如何避免AlassetLibrary的位置服务?
大家好, 我在iPhone开发和OBJ-C是一个新手。我在我的应用程序中使用“ALAssetLibrary”来从照片库中检索图像。 我确定了“ALAssetPropertyLocation”属性关键字仅当位置服务呼叫者启用。它是检索我没有使用“ALAssetPropertyLocation” Property.i我只使用ALAssetPropertyURLs的asset.But的位置信息的关键。
每当我尝试部署我的新设备的应用没有与消息的消息盒子“需要定位服务。” 可我能隐藏“ALAssetPropertyLocation”房产吗?
我真的很感激,如果有人可以帮助我接近我的问题的正确途径,有可能的话任何示例代码让我的开始。
预先感谢您:)
这是我的代码:
//Getting image url from dictionary according to the user input
NSURL *imageurl = [dict objectForKey: [youSaid text]];
//Getting asset from url
typedef void (^ALAssetsLibraryAssetForURLResultBlock)(ALAsset *asset);
typedef void (^ALAssetsLibraryAccessFailureBlock)(NSError *error);
ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *myasset)
{
ALAssetRepresentation *rep = [myasset defaultRepresentation];
CGImageRef iref = [rep fullResolutionImage];
//Setting asset image to image view according to the image url
[imageview setImage:[UIImage imageWithCGImage:iref]];
};
ALAssetsLibraryAccessFailureBlock failureblock = ^(NSError *myerror)
{
NSLog(@"Error, cant get image - %@",[myerror localizedDescription]);
};
if(imageurl != nil)
{
ALAssetsLibrary *assetLibrary=[[ALAssetsLibrary alloc] init];
[assetLibrary assetForURL:imageurl resultBlock:resultblock failureBlock:failureblock];
}
位置服务强制性什么似乎像访问URL的照片/路径的唯一途径?这是虐待。 – AlvinfromDiaspar 2012-07-27 06:32:56