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