我有一個UIDocumentPickerViewController
用下面的代碼:UIDocumentPickerViewController的文件來禁用?
UIDocumentPickerViewController *documentPicker =
[[UIDocumentPickerViewController alloc] initWithDocumentTypes: @[@"public.text", @"public.sql"]
inMode: UIDocumentPickerModeOpen];
documentPicker.delegate = self;
documentPicker.modalPresentationStyle = UIModalPresentationOverFullScreen;
[self presentViewController: documentPicker
animated: YES
completion: nil];
這將打開選擇器,我可以選擇.txt文件,但我不能挑.sql文件。以下屏幕截圖顯示了.sql文件在選取器中的外觀。
我已經添加下面我info.plist
文件,該文件以我的理解,可能需要(忽略UTTypeReferenceURL,我只是試圖讓這個工作。)
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.sql</string>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>SQL statement(s)</string>
<key>UTTypeIconFile</key>
<string>public.sql</string>
<key>UTTypeIdentifier</key>
<string>public.sql</string>
<key>UTTypeReferenceURL</key>
<string>http://www.w3.org/Graphics/JPEG/</string>
</dict>
</array>
我需要做什麼做有UIDocumentPickerViewController
允許採摘.sql文件類型?
'public.database'沒有任何解決問題。我在想這可能是用於sqlite數據庫文件而不是sql腳本。 – Kyle