Rob*_*way 3 xcode objective-c ios ios8
有没有办法区分PHAsset的文件扩展名?我的应用需要知道照片是否是.GIF.我没有看到任何方法这样做.
小智 8
更好的方法是使用uniformTypeIdentifier.文件可以命名为任何内容,可能包含也可能不包含文件扩展名.
[asset valueForKey:@"uniformTypeIdentifier"];
Run Code Online (Sandbox Code Playgroud)
使用 valueForKey:您可以从使用“pathExtension”提取文件扩展名的文件中获取 PHAsset 文件名,例如:PHAsset *selectedAsset = ...
NSString *fileName =[selectedAsset valueForKey:@"filename"];
NSString * fileExtension = [fileName pathExtension];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5538 次 |
| 最近记录: |