This commit is contained in:
Anuken
2019-11-10 23:28:53 -05:00
parent eee06da6b4
commit a73491bb9b

View File

@@ -64,6 +64,24 @@ public class IOSLauncher extends IOSApplication.Delegate{
try{
coord.coordinateReadingItem(documentURLs.get(0), NSFileCoordinatorReadingOptions.None, url -> {
if(url.startAccessingSecurityScopedResource()){
try{
controller.importDocument(url, new NSURL(getDocumentsDirectory() + "/document"), UIDocumentBrowserImportMode.Copy, (result, error) -> {
if(error != null){
ui.showErrorMessage("Import error.\n" + error.getLocalizedFailureReason() + "\n" + error.getLocalizedDescription());
}else{
try{
cons.get(Core.files.absolute(url.getPath()));
}catch(Throwable t){
ui.showException(t);
}
}
});
}catch(Throwable t){
ui.showException(t);
}
/*
try{
int[] tread = {0};
@@ -106,7 +124,7 @@ public class IOSLauncher extends IOSApplication.Delegate{
ui.showException(t3);
}
}
}
}*/
}else{
ui.showErrorMessage("Failed to access file.");
}