簡體   English   中英

如何限制我的應用程序顯示在特定文檔類型的iOS“打開於...”菜單中

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

我需要限制我的應用程序才能顯示ppt文件類型。如何執行此操作?

您可以使用它。 這將獲得文件的“種類”。

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

之后像這樣檢查

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

}

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM