【发布时间】:2020-04-04 07:04:56
【问题描述】:
我正在尝试从 PHAsset 或资产库生成 UIImage。我的代码是这样的:
NSString *path = [self.options valueForKey:@"path"];
NSURL *localurl = [NSURL URLWithString:path];
NSData *data = [NSData dataWithContentsOfURL:localurl];
UIImage *image = [[UIImage alloc] initWithData:data];
但是 UIImage 是零。我可以将路径设置为ph:// 或assets-library://。
谢谢!
【问题讨论】:
-
@matt 阅读问题。
标签: objective-c uiimage