2011-07-19 54 views
2

當用戶搜索網絡中的圖像,並且他/她選擇它時,我希望我的應用程序被註冊以打開它。這是我所包含的,但該應用程序沒有檢測到圖像文件!如何讓我的應用程序打開PNG文件?

<dict> 
<key>CFBundleTypeName</key> 
<string>PNG Image</string> 
<key>CFBundleTypeRole</key> 
<string>Viewer</string> 
<key>CFBundleTypeExtensions</key> 
<array> 
    <string>png</string> 
    <string>PNG</string> 
</array> 
<key>LSHandlerRank</key> 
<string>Alternate</string> 
<key>LSItemContentTypes</key> 
<array> 
    <string>public.png</string> 
</array> 
</dict> 

回答

0

你要做的只是適用於Mac OS X,不適用於iPhone。這裏解釋:DocumentBasedApplications -- editor and viewer role

在iOS上,您的應用程序位於沙箱(The Application Runtime Environment)中。

每個應用程序都可以訪問自己的沙箱的內容,但 無法訪問其他應用程序的沙箱。

+0

但我能夠通過將其包含在plist中來訪問pdf文檔。它運行在iPad上。任何想法?? – Vignesh

+0

您包含在應用程序包中的文件位於應用程序的沙箱中,可以訪問(例如您的pdf)。 – progrmr

+0

不!我的意思是我的應用程序能夠通過電子郵件附件打開pdf。它不在沙箱中。如果這可能爲什麼不是PNG文件? – Vignesh

相關問題