简体   繁体   English

如何限制我的应用程序显示在特定文档类型的iOS“打开于...”菜单中

[英]How do I restrict my application to show up in the “Open in…” menu on iOS for a specific document type

我需要限制我的应用程序才能显示ppt文件类型。如何执行此操作?

You can use this. 您可以使用它。 This will get the 'kind' of file. 这将获得文件的“种类”。

- (NSString *)humanReadableFileType:(NSString *)path
{
    NSString *kind = nil;
    NSURL *url = [NSURL fileURLWithPath:[path stringByExpandingTildeInPath]];
    LSCopyKindStringForURL((CFURLRef)url, (CFStringRef *)&kind);
    return kind ? [kind autorelease] : @"";
}

After that check it like that 之后像这样检查

if([kind isEqualToString:@"ppt"])
{

}

Source: http://importantshock.wordpress.com/2007/01/07/cocoa-snippet-finding-a-files-kind/#post-19 来源: http//importantshock.wordpress.com/2007/01/07/cocoa-snippet-finding-a-files-kind/#post-19

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 对于任何文档类型,如何使我的应用程序显示在iOS的“打开于...”菜单中? - How do I get my application to show up in the “Open in…” menu on iOS for ANY document type? 如何让我的应用程序显示在ios notes菜单上的添加人员中 - How do I get my application to show up in the add people on ios notes menu 如何让我的应用程序显示在 ios13 中 plist 文件的“open-in”菜单中? - How do I make my app show up in "open-in"-menu for plist-files in ios13? iOS:如何在我的应用程序中打开Facebook App中的特定帖子? - iOS: How do I open a specific post in the Facebook App from within my application? 如何使用自定义iOS应用程序中的URL链接将Safari(或Adobe或任何其他应用程序)打开到特定网页或文档? - How to open Safari (or Adobe, or any other app) to a specific webpage or document using a URL link from within my custom iOS application? 如何从我的 iOS 应用程序启动 Apple Pages 文档? - How do I launch an Apple Pages document from my iOS application? 如何使我的应用程序显示在iPhone的“打开位置...”列表中? - How do I get my app to show up in the “Open In…” List on iPhone? 如何在iOS的导航项中显示后退栏按钮项? - How do I get the back bar button item to show up in my navigation item in iOS? 我应该如何通过电子邮件发送自己格式的文件,如何才能在iOS 5中自己的应用程序中打开文件? - How should i send file of my own format with email and what should i do to be able to open it in my own application in iOS 5? iOS-如何限制特定用户在不同设备上安装应用程序 - iOS - How to restrict application installs on different devices for a specific user
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM