大佬教程收集整理的这篇文章主要介绍了从iphone照片库中获取照片并在表格视图中显示,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
NSMutableArray *assets = [[NSMutableArray alloc]init]; ALAssetsLibrary *library = [[ALAssetsLibrary alloc]init]; [library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group,BOOL *stop){ if(group != NULL){ [group enumerateAssetsUsingBlock:^(ALAsset *result,NSUInteger index,BOOL *stop){ if(result != NULL){ [assets addObject:result]; }else NSLog(@"NO photo");; }]; } } failureBlock:^(NSError *error){NSLog(@"Error");}];
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowATindexPath:(NSIndexPath *)indexPath{ NSString *identifier = @"id"; UITableViewCell *cell = (UITableViewCell*)[tableView dequeueReusableCellWithIdentifier:identifier]; if(cell == NULL){ cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reusEIDentifier:identifier]; } [cell.imageView setImage:[UIImage imageWithCGImage:[[assets objectATindex:indexPath.row]thumbnail]]]; [cell textLabel].text = @"Photo"; return cell;
}
请求帮助我做错了….
感谢帮助
@H_403_4@
http://agilewarrior.wordpress.com/tag/alassetslibrary/
@H_403_4@ @H_403_4@以上是大佬教程为你收集整理的从iphone照片库中获取照片并在表格视图中显示全部内容,希望文章能够帮你解决从iphone照片库中获取照片并在表格视图中显示所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。