如何让我的应用程序打开 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>
When a user search for images in net and he/she is selecting it, i want my app to be registered to open it. This is what I have included but the app is not detecting image files!
<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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您尝试做的事情仅适用于 Mac OS X,不适用于 iPhone。解释如下: DocumentBasedApplications -- 编辑者和查看者角色
在 iOS 上,您的应用程序位于沙箱(应用程序运行时环境)。
What you are trying to do is only available for Mac OS X, not for iPhone. It is explained here: DocumentBasedApplications -- editor and viewer role
On iOS your application is in a sandbox (The Application Runtime Environment).