Tag: nsurl nsfilemanager

如何检索与FileManager的嵌套文件?

在我的应用程序中,我第一次启动应用程序时就创build了这个文件夹结构: 我在这里读取我可以保存数据库中的文件的绝对path吗? – 我不应该存储目录或文件的绝对path。 因此,我无法获得上图中显示的最后一个文件,称为 I-Want-This-File-Path 。 我可以访问上图中的Feed文件夹,如下所示: extension FileManager { /// APPLICATION SUPPORT DIRECTORY static func createOrFindApplicationSupportDirectory() -> URL? { let bundleID = Bundle.main.bundleIdentifier // Find the application support directory in the home directory. let appSupportDir = self.default.urls(for: .applicationSupportDirectory, in: .userDomainMask) guard appSupportDir.count > 0 else { return nil } // Append the bundle […]