在iOS模拟器上打开文件与应用程序?

我如何打开一个文件(它的XML文件)与我的iOS应用程序即时开发。 我想testing我的:UIApplicationLaunchOptionsURLKey实现。 我该怎么做呢? iOS模拟器没有与邮件或任何东西,所以我无能为力testing这种function。 有任何想法吗? 谢谢!

我在Xcode的目标属性位下的文档types,所以我非常确定这是正确的:

<dict> <key>CFBundleTypeIconFiles</key> <array> <string>icon</string> </array> <key>CFBundleTypeName</key> <string>XML File</string> <key>LSItemContentTypes</key> <array> <string>public.XML</string> </array> </dict> 

你想要的东西看起来像这样:

 <key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeName</key> <string>XML File</string> <key>LSHandlerRank</key> <string>Alternate</string> <key>LSItemContentTypes</key> <array> <string>public.xml</string> </array> </dict> </array> 

这应该是Info.plist文件中的一个条目。

使用Apple提供的示例应用程序 ,您可以在此应用程序中包含您的文件,它可以让您进行“打开”,您可以在其中select您的应用程序。

您只需在模拟器上拖放文件即可。 如果您的应用程序注册该文件types,您的应用程序将打开并处理它。