首页 > 代码库 > 从 ALAsset 中取出属性
从 ALAsset 中取出属性
#pragma mark - 从相册数组中取出所有的 图片数据-(NSMutableArray *)getImageFromAlbumArray:(NSArray *)albumArr{ NSMutableArray *imageArray = [[NSMutableArray alloc]init]; if (albumArr && [albumArr count]!=0) { for (int i=0;i<[albumArr count];i++) { ALAsset * assetPhotos = [albumArr objectAtIndex:i]; //类型, Location , 时长,方向,日期,格式 , URL地址 NSString * nsALAssetPropertyType = [ assetPhotos valueForProperty:ALAssetPropertyType ] ; NSString * nsALAssetPropertyLocation = [ assetPhotos valueForProperty:ALAssetPropertyLocation ] ;//拍照地址 NSString * nsALAssetPropertyDuration = [ assetPhotos valueForProperty:ALAssetPropertyDuration ] ; NSString * nsALAssetPropertyOrientation = [ assetPhotos valueForProperty:ALAssetPropertyOrientation ] ; NSString * nsALAssetPropertyDate = [ assetPhotos valueForProperty:ALAssetPropertyDate ] ; NSString * nsALAssetPropertyRepresentations = [ assetPhotos valueForProperty:ALAssetPropertyRepresentations ] ; NSString * nsALAssetPropertyURLs = [ assetPhotos valueForProperty:ALAssetPropertyURLs ] ; NSString * nsALAssetPropertyAssetURL = [ assetPhotos valueForProperty:ALAssetPropertyAssetURL ] ; NSLog(@"**************** ALAsset Date : %@ , URLs : %@ ",nsALAssetPropertyDate,nsALAssetPropertyURLs ); //type:ASSET_PHOTO_ASPECT_THUMBNAIL 取大图会造成内存溢出 UIImage *tempImg = [ASSETHELPER getImageFromAsset:assetPhotos type:ASSET_PHOTO_ASPECT_THUMBNAIL]; [imageArray addObject:tempImg]; } } return imageArray;}
从 ALAsset 中取出属性
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。