私はこれを読みました: iOSアプリでテキストファイルを開くと、アプリを開くオプションの1つとしてアプリを見ることができ、アプリを選択するとアプリが開きますが、それだけです。2 つの問題があります。
まず第一に、たとえば Google ドライブの「open with」では「Copy to Drive」と表示されますが、私は「Copy to HotSpotRIS」と言いたいときに「Copy to (null)」と表示します。これどうやってするの?少なくともアプリのアイコンは表示されます。私のプロジェクト全体の全体的なバンドル ID は、www.epicode.com.HotSpotRIS です。これは、私が具体的に話していることを示す 3 つの写真です。最初の写真は、メールで送信された txt を示しています。2 番目の写真は、ユーザーが txt ファイルを押したままにしている様子です。3 番目の写真は、これからポップアップする「開く」メニューです。 「コピー先(null)」を読んでいる私のアプリ:
次に、テキスト ファイルの読み書きと iOS ファイル システムの操作方法は知っていますが、電子メールで送信された txt ファイルを読み取るためにコードを .plist ファイルに接続するにはどうすればよいでしょうか。私は、txt データを取得するために呼び出すために使用できる識別子が必要であると推測しています。ここまでの私の info.plist ファイルは、ファイルの最後のビットが、iOS アプリで開いているテキスト ファイルから取得したコードです。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>CFBundleGetInfoString</key>
<string></string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>NSLocationWhenInUseUsage</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>CFBundleDisplayName</key>
<string></string>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>Text File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>txt</string>
<string>TXT</string>
</array>
<key>LSHandlerRank</key>
<string>Alternate</string>
<key>LSItemContentTypes</key>
<array>
<string>www.epicode.com.HotSpotRIS.txt</string>
</array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.text</string>
</array>
<key>UTTypeDescription</key>
<string>Plain Text Document</string>
<key>UTTypeIdentifier</key>
<string>www.epicode.com.HotSpotRIS.txt</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<string>txt</string>
<key>public.mime-type</key>
<string>text/plain</string>
</dict>
</dict>
</array>
</dict>
</plist>
前もって感謝します!