[英]Image file extension Xcode
I'm programming an app similar to the email. 我正在编写类似于电子邮件的应用程序。 So when I attach a file to my message I would like to show the filename + small image (icon), this icon should be according the filetype, for example pdf if the file is a pdf, Word id the file is a word file ....
因此,当我在邮件中附加文件时,我想显示文件名+小图像(图标),该图标应与文件类型相对应,例如pdf(如果文件是pdf),Word id(文件id)是word文件。 ...
Anyone know how can I find these small images ? 有人知道如何找到这些小图像吗? Or any representative example ?
还是有代表性的例子?
Advanced thank 先进的谢谢
If this is for iOS then you can use UIDocumentInteractionController : 如果这是针对iOS的,则可以使用UIDocumentInteractionController :
NSURL *url = [NSURL fileURLWithPath:pathToYourFile];
UIDocumentInteractionController *diac = [UIDocumentInteractionController interactionControllerWithURL:url];
NSArray *icons = diac.icons;
if ([icons count] > 0) {
// This is the smallest available icon:
UIImage *icon = [icons objectAtIndex:0];
} else {
// No icon found.
// According to the documentation, this case *should not* occur...
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.