2017-10-27 36 views
-5

私はSwiftを直接使ってアプリケーションを開発し始めたので、Objective Cのアイデアはほとんど分かっていませんでしたが、Objective Cで実装されたプロジェクトを取り上げていくつかのバグを修正しなければなりませんでした。 SwiftからObjective Cへのコードの変換?

は、私は私が

func mySpecialFunction(){ 

let importMenu = UIDocumentMenuViewController(documentTypes: [String(kUTTypePDF)], in: .import) 
      importMenu.delegate = self 
      importMenu.modalPresentationStyle = .formSheet  
      self.present(importMenu, animated: true, completion: nil) 
} 

は、今私はいくつかの研究を行っているのObjective Cに変換したいスウィフトのコードに出くわしたとなった。この

UIDocumentMenuViewController *importMenu = *Code Here* ; 
importMenu.delegate = self; 
importMenu.modalPresentationStyle = UIModalPresentationFormSheet; 
[self presentModalViewController:importMenu animated:YES]; 
誰がどのように私をすることができます助けて私はでき

コード内のObjective Cに変換された最初の行を取得しますか?

+0

可能な重複https://stackoverflow.com/questions/33099775/how-to-initialise-uidocumentpickerviewcontroller-with-all-type -of-utis) –

答えて

-1

これを試してください。

UIDocumentMenuViewController *importMenu = [[UIDocumentMenuViewController alloc] initWithDocumentTypes:@[(__bridge NSString*)kUTTypeContent] inMode:UIDocumentPickerModeImport]; 
-1

UIDocumentMenuViewController * importMenu = [[UIDocumentMenuViewController ALLOC] initWithDocumentTypes:@ [ "public.item" @、kUTTypeContent(NSStringの* __bridge)、kUTTypeData(NSStringの* __bridge)、(NSStringの* __bridge)kUTTypePackage、(__bridge NSString *)kUTTypeDiskImage、@ "com.apple.iwork.pages.pages"、@ "com.apple.iwork.numbers.numbers"、@ "com.apple.iwork.keynote.key"] inMode:UIDocumentPickerModeImport];

使用上のコード

([尿路感染のすべてのタイプのUIDocumentPickerViewControllerを初期化する方法]の
関連する問題