我正在使用ALAsset Framework访问设备照片库中的文件.
到目前为止,我可以访问缩略图并显示它.
我想在图像视图中显示实际图像,但我无法弄清楚如何执行此操作.
我尝试使用ALAsset对象中的URL字段但未成功.
谁知道如何做到这一点?
这是我能够访问缩略图并将其放在表格单元格中的一些代码:
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
//here 'asset' represents the ALAsset object
asset = [assets objectAtIndex:indexPath.row];
//i am accessing the thumbnail here
[cell.imageView setImage:[UIImage imageWithCGImage:[asset thumbnail]]];
[cell.textLabel setText:[NSString stringWithFormat:@"Photo %d", indexPath.row+1]];
return cell;
}
Run Code Online (Sandbox Code Playgroud) 在iPhone应用程序中,是否有可能从用iPhone相机拍摄的照片中提取位置信息(地理编码,我想它的名字)?
如果没有API调用,是否有任何已知的方法来解析数据字节以提取信息?我可以自己滚动的东西?